Hi,

The help text for echo describes the effect of the backslash escape 
\c like this:

$ help echo | grep '\\c'
        \c      suppress trailing newline

But what it actually does is different:

$ echo -e "before \c after \a"
before $

It cancels all characters that come after it.  The printf command 
from coreutils has a nice concise description for it:

$ /usr/bin/printf --help | grep '\\c'
  \c      produce no further output

Attached patch makes bash's builtin echo use the same description.

Benno
diff -ur bash-3.2.orig/builtins/echo.def bash-3.2/builtins/echo.def
--- bash-3.2.orig/builtins/echo.def	2006-09-08 19:41:17.000000000 +0200
+++ bash-3.2/builtins/echo.def	2008-08-12 12:30:43.000000000 +0200
@@ -42,7 +42,7 @@
 following backslash-escaped characters is turned on:
 	\a	alert (bell)
 	\b	backspace
-	\c	suppress trailing newline
+	\c	produce no further output
 	\E	escape character
 	\f	form feed
 	\n	new line
diff -ur bash-3.2.orig/doc/bash.1 bash-3.2/doc/bash.1
--- bash-3.2.orig/doc/bash.1	2006-10-03 14:54:26.000000000 +0200
+++ bash-3.2/doc/bash.1	2008-08-12 12:28:16.000000000 +0200
@@ -6617,7 +6617,7 @@
 backspace
 .TP
 .B \ec
-suppress trailing newline
+produce no further output
 .TP
 .B \ee
 an escape character
diff -ur bash-3.2.orig/doc/bashref.texi bash-3.2/doc/bashref.texi
--- bash-3.2.orig/doc/bashref.texi	2006-09-28 16:25:28.000000000 +0200
+++ bash-3.2/doc/bashref.texi	2008-08-12 12:30:08.000000000 +0200
@@ -3323,7 +3323,7 @@
 @item \b
 backspace
 @item \c
-suppress trailing newline
+produce no further output
 @item \e
 escape
 @item \f

Reply via email to