From: Pádraig Brady Date: Mon, 14 Jul 2014 01:49:47 +0000 (+0100) Subject: tests: fix portabilitiy issue in new od-endian test X-Git-Tag: v8.23~8 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=37b36018d3f5f276622a9888e32623f9410a80e0;p=thirdparty%2Fcoreutils.git tests: fix portabilitiy issue in new od-endian test * tests/misc/od-endian.sh: '\n' is not generally supported in the replacement, so use the more portable "\\$NL". --- diff --git a/tests/misc/od-endian.sh b/tests/misc/od-endian.sh index 5ee17e6179..a01ae0a805 100755 --- a/tests/misc/od-endian.sh +++ b/tests/misc/od-endian.sh @@ -21,15 +21,18 @@ print_ver_ od in='0123456789abcdef' +NL=' +' + # rev(1) is not generally available, so here's a simplistic # implementation sufficient for our purposes. rev() { while read line; do - printf '%s' "$line" | sed 's/./&\n/g' | tac | paste -s -d '' + printf '%s' "$line" | sed "s/./&\\$NL/g" | tac | paste -s -d '' done } -in_swapped() { printf '%s' "$in" | sed "s/.\{$1\}/&\\n/g" | rev | tr -d '\n'; } +in_swapped() { printf '%s' "$in" | sed "s/.\{$1\}/&\\$NL/g" | rev |tr -d '\n'; } for e in little big; do test $e = little && eo=big || eo=little