summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorPádraig Brady <P@draigBrady.com>2009-10-27 10:04:34 +0000
committerPádraig Brady <P@draigBrady.com>2009-10-28 16:37:07 +0000
commit2904d675a49cdd7cb2372f50592a6823106aa0f7 (patch)
tree4ec374f8d26b4f1ac3e7454233ab0adc732cc2b8 /tests
parent54491d275184428be6e28e3f22f04859b7288105 (diff)
downloadcoreutils-2904d675a49cdd7cb2372f50592a6823106aa0f7.tar.xz
echo, printf: interpret \e as the Escape character
Match gcc, perl, bash, ksh, tcsh, ... in supporting \e. * src/printf.c (print_escape_char): Output \x1B when \e encountered. * src/echo.c (main): Likewise. * src/stat.c (print_escape_char): Likewise. * doc/coreutils.texi (echo invocation): Add \e to the list. * tests/misc/printf: Verify that \e outputs \x1B. * NEWS: Mention the change in behaviour.
Diffstat (limited to 'tests')
-rwxr-xr-xtests/misc/printf3
1 files changed, 3 insertions, 0 deletions
diff --git a/tests/misc/printf b/tests/misc/printf
index e02a1328b..8961b4433 100755
--- a/tests/misc/printf
+++ b/tests/misc/printf
@@ -28,6 +28,9 @@ getlimits_
fail=0
+# Verify the 3 methods of specifying "Escape":
+test $("$prog" "\x1b\n\33\n\e\n" | uniq -u) && fail=1
+
# This would fail (by printing the `--') for printf in sh-utils
# and in coreutils 4.5.1.
"$prog" -- 'foo\n' > out || fail=1