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. --- src/echo.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/echo.c') diff --git a/src/echo.c b/src/echo.c index 90b978646..65e8c80e4 100644 --- a/src/echo.c +++ b/src/echo.c @@ -70,6 +70,7 @@ If -e is in effect, the following sequences are recognized:\n\ "), stdout); fputs (_("\ \\c produce no further output\n\ + \\e escape\n\ \\f form feed\n\ \\n new line\n\ \\r carriage return\n\ @@ -203,6 +204,7 @@ just_echo: case 'a': c = '\a'; break; case 'b': c = '\b'; break; case 'c': exit (EXIT_SUCCESS); + case 'e': c = '\x1B'; break; case 'f': c = '\f'; break; case 'n': c = '\n'; break; case 'r': c = '\r'; break; -- cgit v1.2.3-54-g00ecf