echo(1) should do backslash escapes when in POSIXLY_CORRECT mode
[email protected] Tue, 6 Aug 2002 12:14:02 +0200
| Newsgroups | gmane.comp.gnu.sh-utils.bugs |
|---|---|
| Message-ID | <[email protected]> |
hi, according to http://www.opengroup.org/onlinepubs/007904975/utilities/echo.html the echo command should interpret backslash escape sequences. I am not sure if the document is relevant (what is the appropriate source for POSIX specs?), but the behaviour seems reasonable. ingo Ingo Koehne <[email protected]> --- src/echo.c.orig Tue Aug 6 11:49:28 2002 +++ src/echo.c Tue Aug 6 11:45:36 2002 @@ -123,14 +123,16 @@ if (getenv ("POSIXLY_CORRECT") == NULL) parse_long_options (argc, argv, PROGRAM_NAME, GNU_PACKAGE, VERSION, AUTHORS, usage); - else + else { allow_options = 0; + do_v9 = 1; + } /* System V machines already have a /bin/sh with a v9 behaviour. We use the identical behaviour for these machines so that the existing system shell scripts won't barf. */ #if defined (V9_ECHO) && defined (V9_DEFAULT) - do_v9 = allow_options; + do_v9 = 1; #endif --argc;