25.12 Double Space, Triple Space ...Here are handy scripts for printing drafts of files. They double-space or triple-space file(s) or standard input. For example: %
doublespace triplespace #!/bin/sed -f #!/bin/sed -f G G G No, that isn't a typo: both scripts just use the sed command G (34.24 ) . The G command appends a newline and the contents of sed 's hold space, which will be empty in this script. The effect is to add a newline after every newline; two G s add two newlines. That file doesn't even use a shell, so it's efficient; the kernel
starts sed
directly (45.3
)
and gives it the script itself as the input file expected with the
-f
option.
If your UNIX can't execute files directly with doublespace triplespace exec /bin/sed G ${1+"$@"} exec /bin/sed 'G;G' ${1+"$@"}
They start a shell, then
exec
replaces the shell with sed
(45.7
)
.
The And now you know how to make quadruplespace
,
quintuplespace
, ... - |
|