aboutsummaryrefslogtreecommitdiff
path: root/tools/star/prefix.pl
blob: c2dea0a9dd09a343cfbe5f7dacbc783890c39710 (plain)
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$_"; 
}