Files
mercury/tools/add_cont_lines
Zoltan Somogyi 2af05e4079 New script to help add continuation marks to the ends of lines.
Estimated hours taken: 0.1
Branches: main

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.
2005-08-03 23:38:03 +00:00

16 lines
348 B
Bash
Executable File

#!/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";
}' "$@"