#! /usr/bin/perl use warnings; use strict; sub make_link($$) { my ( $source, $target ) = @_; warn "$target exists\n" and return if -e $target; warn "Cannot find $source\n" and return unless -s $source; symlink $source, $target or warn "Unable to symlink $source, $target: $!"; } while ( ) { my ( $rfcnum, $description ) = m/^rfc(\d{4})\.txt\s+(.*)/; next unless $rfcnum; # Format the text nicely for lecture slides: ( my $text_desc = $description ) =~ s/-/ /g; $text_desc =~ s/(snmp|smi|mib|usm|vacm)/\U$1/g; print "RFC $rfcnum & \u$text_desc \\\\\n"; my $target = "rfc$rfcnum-$description.txt"; my $source = "rfc$rfcnum.txt"; make_link "rfc$rfcnum.txt", "rfc$rfcnum-$description.txt"; make_link "rfc$rfcnum-stripped.txt", "rfc$rfcnum-$description-stripped.txt"; } __DATA__ rfc1155.txt snmpv1 rfc1157.txt smiv1 rfc1212.txt concise-mib-definitions rfc1215.txt snmpv1-traps rfc1901.txt snmpv2c rfc2570.txt old-snmpv3-overview rfc2578.txt smiv2 rfc2579.txt smiv2-textual-conventions rfc2580.txt smiv2-conformance rfc3411.txt snmpv3-architecture rfc3412.txt snmpv3-message-processing rfc3413.txt snmpv3-applications rfc3414.txt snmpv3-usm rfc3415.txt snmpv3-vacm rfc3416.txt snmpv2-protocol-operations rfc3417.txt snmpv2-transport-mappings rfc3418.txt snmpv2-mib rfc3512.txt snmp-configuring-networks-info rfc3584.txt snmp-coexistence-v1-v2-v3-best-practice