1 2 3 4 5 6 7 8 9 10 11 12
#! perl # Add a prefix string (specified by $ARGV[0]) to all # of the lines of the remaining files. Skips blank lines # and lines beginning with a comment character. my $prefix = shift @ARGV; while (<>) { next if /^\s*(#|$)/; print "$prefix$_"; }