aboutsummaryrefslogtreecommitdiff
path: root/tools/star/prefix.pl
diff options
context:
space:
mode:
Diffstat (limited to 'tools/star/prefix.pl')
-rw-r--r--tools/star/prefix.pl12
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$_";
+}
+