[m-rev.] diff: add_cont_lines

Zoltan Somogyi zs at cs.mu.OZ.AU
Thu Aug 4 09:37:36 AEST 2005


tools/add_cont_lines:
	New script to help add continuation marks to the ends of lines.
	This is useful e.g. when converting C functions to macros.

Zoltan.

cvs diff: Diffing .
Index: add_cont_lines
===================================================================
RCS file: add_cont_lines
diff -N add_cont_lines
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ add_cont_lines	3 Aug 2005 01:50:22 -0000
@@ -0,0 +1,15 @@
+#!/bin/sh
+# This script add a backslash to the end of every line in its input.
+# The input can come either from a list of files named on the command line
+# or from standard input.
+#
+# This script assumes that there are no tabs in the input.
+
+awk '
+	{
+		printf "%s", $0;
+		for (i = length($0); i < 78; i++)
+			printf " ";
+
+		printf "\\\n";
+	}' "$@"
--------------------------------------------------------------------------
mercury-reviews mailing list
post:  mercury-reviews at cs.mu.oz.au
administrative address: owner-mercury-reviews at cs.mu.oz.au
unsubscribe: Address: mercury-reviews-request at cs.mu.oz.au Message: unsubscribe
subscribe:   Address: mercury-reviews-request at cs.mu.oz.au Message: subscribe
--------------------------------------------------------------------------



More information about the reviews mailing list