bug-sh-utils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

echo(1) should do backslash escapes when in POSIXLY_CORRECT mode


From: ingok
Subject: echo(1) should do backslash escapes when in POSIXLY_CORRECT mode
Date: Tue, 6 Aug 2002 12:14:02 +0200
User-agent: Mutt/1.4i

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 <address@hidden>


--- 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;




reply via email to

[Prev in Thread] Current Thread [Next in Thread]