From: David Levine Date: Sun, 8 Dec 2013 18:15:18 +0000 (-0600) Subject: Try this sed command for squeeze_lines(). X-Git-Url: https://diplodocus.org/git/nmh/commitdiff_plain/c5515a353e7316cb1c2ba3d4dce2979d5779ce37?hp=4929cad323afc87404752a1e88664a7f42cbb737 Try this sed command for squeeze_lines(). --- diff --git a/test/common.sh.in b/test/common.sh.in index 94b41906..8f5d576c 100644 --- a/test/common.sh.in +++ b/test/common.sh.in @@ -126,11 +126,11 @@ check_for_hard_links () { set -e } -#### Filter that squeezes blank lines, emulating GNU cat -s. +#### Filter that squeezes blank lines, partially emulating GNU cat -s, +#### but sufficient for our purpose. +#### From http://www-rohan.sdsu.edu/doc/sed.html, compiled by Eric Pement. squeeze_lines() { - awk 'length($0) == 0 && e == 1 { next } - { e = length($0) == 0 } - { print }' + sed '/^$/N;/\n$/D' } #### Filter that inserts initial whitespace and converts non-breakable