From: Jim Meyering Date: Wed, 25 Feb 2009 18:51:04 +0000 (+0100) Subject: tests: using printf with \e for ESC isn't portable X-Git-Tag: v7.2~83 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=bba5a47651a4a09f745f7f996c3b22fc410fabef;p=thirdparty%2Fcoreutils.git tests: using printf with \e for ESC isn't portable * tests/ls/color-clear-to-eol: Use \33, not \e for ascii ESC. This test failed when using the built-in printf of /bin/sh from NetBSD 1.6. --- diff --git a/tests/ls/color-clear-to-eol b/tests/ls/color-clear-to-eol index ff9530d72b..92cf8a8cab 100755 --- a/tests/ls/color-clear-to-eol +++ b/tests/ls/color-clear-to-eol @@ -26,9 +26,10 @@ fi long_name=zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz.foo touch $long_name || framework_failure +e='\33' color_code='0;31;42' -c_pre='\e[0m\e['"${color_code}m" -c_post='\e[0m\e[K\n\e[m' +c_pre="$e[0m$e[${color_code}m" +c_post="$e[0m$e[K\n$e[m" printf "$c_pre$long_name$c_post" > exp || framework_failure fail=0