From 2904d675a49cdd7cb2372f50592a6823106aa0f7 Mon Sep 17 00:00:00 2001 From: Pádraig Brady Date: Tue, 27 Oct 2009 10:04:34 +0000 Subject: 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. --- tests/misc/printf | 3 +++ 1 file changed, 3 insertions(+) (limited to 'tests') 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 -- cgit v1.2.3-54-g00ecf