25.11 crush: A cat that Skips all Blank LinesSometimes I have a series of files, or just one file, with lots of blank lines. Some systems have a -s option to cat that causes it to compress adjacent blank lines into one. If that option isn't available, you can use crush . The crush script skips all lines that are empty or have only blanks and/or TABs. Here it is: #!/bin/sed -f /^[ ]*$/d The brackets, exec sed '/^[ ]*$/d' ${1+"$@"} It starts a shell, then
exec
replaces the shell with sed
(45.7
)
.
The - |
|