mirror of
https://github.com/Mercury-Language/mercury.git
synced 2025-12-08 18:34:00 +00:00
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.
16 lines
348 B
Bash
Executable File
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";
|
|
}' "$@"
|