diff options
author | pmichaud <pmichaud@pobox.com> | 2012-08-28 03:24:06 -0500 |
---|---|---|
committer | pmichaud <pmichaud@pobox.com> | 2012-08-28 03:24:06 -0500 |
commit | a127aa7a02cf8b53d8d5dd0cbb623f985f59ad52 (patch) | |
tree | 2673021bc8cd77035d379304ba16013819555823 /tools/star/prefix.pl | |
parent | 186a6326e820946c9c74150ecfab8bc0aa95334e (diff) |
Initial build makefile and script to prefix input lines.
Diffstat (limited to 'tools/star/prefix.pl')
-rw-r--r-- | tools/star/prefix.pl | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/tools/star/prefix.pl b/tools/star/prefix.pl new file mode 100644 index 0000000..c2dea0a --- /dev/null +++ b/tools/star/prefix.pl @@ -0,0 +1,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$_"; +} + |