diff options
| author | Jordan K. Hubbard <jkh@FreeBSD.org> | 1995-08-31 17:25:55 +0000 |
|---|---|---|
| committer | Jordan K. Hubbard <jkh@FreeBSD.org> | 1995-08-31 17:25:55 +0000 |
| commit | 6cef43a78b905a289b068535a427e62bde72faff (patch) | |
| tree | 217e765b340a446289a167de6be25ad42d5e423b | |
| parent | f0be1274ca3a199ce33636fa96edfb1d537014f7 (diff) | |
Notes
| -rw-r--r-- | bin/echo/echo.1 | 6 | ||||
| -rw-r--r-- | bin/echo/echo.c | 12 |
2 files changed, 13 insertions, 5 deletions
diff --git a/bin/echo/echo.1 b/bin/echo/echo.1 index b74272c8a9f2..d045b3dcc67c 100644 --- a/bin/echo/echo.1 +++ b/bin/echo/echo.1 @@ -33,7 +33,7 @@ .\" SUCH DAMAGE. .\" .\" @(#)echo.1 8.1 (Berkeley) 7/22/93 -.\" $Id$ +.\" $Id: echo.1,v 1.2 1994/09/24 02:55:17 davidg Exp $ .\" .Dd July 22, 1993 .Dt ECHO 1 @@ -55,7 +55,9 @@ output. The following option is available: .Bl -tag -width flag .It Fl n -Do not print the trailing newline character. +Do not print the trailing newline character. This may also be +achieved by appending `\ec' to the end of the string, as is done +by iBCS2 compatible systems. .El .Pp The diff --git a/bin/echo/echo.c b/bin/echo/echo.c index ba9f9ed7cc2b..e604765e48a3 100644 --- a/bin/echo/echo.c +++ b/bin/echo/echo.c @@ -30,7 +30,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id$ + * $Id: echo.c,v 1.2 1994/09/24 02:55:18 davidg Exp $ */ #ifndef lint @@ -62,8 +62,14 @@ main(argc, argv) else nflag = 0; - while (*argv) { - (void)printf("%s", *argv); + while (argv[0]) { + int len = strlen(argv[0]); + + if (len >= 2 && !argv[1] && argv[0][len - 2] == '\\' && argv[0][len - 1] == 'c') { + argv[0][len - 2] = '\0'; + nflag = 1; + } + (void)printf("%s", argv[0]); if (*++argv) putchar(' '); } |
