X-Git-Url: https://diplodocus.org/git/nmh/blobdiff_plain/4d0e01fe1da830a6e8fdf13bd6bc21603642d5da..43a65e9777214029046fe7a1427493e6e503a717:/test/common.sh.in diff --git a/test/common.sh.in b/test/common.sh.in index b373b2f1..6c9652ce 100644 --- a/test/common.sh.in +++ b/test/common.sh.in @@ -126,15 +126,16 @@ 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 && e {next} {e = !length} 1' + sed '/^$/N;/\n$/D' } -#### Filter that inserts initial whitespace and converts non-breakable -#### space U+00A0 to an ASCII space. +#### Filter that converts non-breakable space U+00A0 to an ASCII space. prepare_space() { - sed 's/^/ /; s/'"`printf '\\302\\240'`"'/ /g' + sed 's/'"`printf '\\302\\240'`"'/ /g' } #### check() requires two arguments, each the name of a file to be