tests: using printf with \e for ESC isn't portable
authorJim Meyering <meyering@redhat.com>
Wed, 25 Feb 2009 18:51:04 +0000 (19:51 +0100)
committerJim Meyering <meyering@redhat.com>
Wed, 25 Feb 2009 21:43:07 +0000 (22:43 +0100)
* 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.

tests/ls/color-clear-to-eol

index ff9530d..92cf8a8 100755 (executable)
@@ -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