Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 9 Nov 1997 16:19:08 +0100 (MET)
From:      Wolfgang Helbig <helbig@Informatik.BA-Stuttgart.DE>
To:        rkw@dataplex.net (Richard Wackerbarth)
Cc:        joerg_wunsch@uriah.heep.sax.de, freebsd-hackers@FreeBSD.ORG
Subject:   Re: Why doesn't /bin/echo use getopt?
Message-ID:  <199711091519.QAA04460@rvc1.informatik.ba-stuttgart.de>
In-Reply-To: <l03110701b08b4c1e60fd@[208.2.87.4]> from Richard Wackerbarth at "Nov 9, 97 05:17:39 am"

next in thread | previous in thread | raw e-mail | index | archive | help
> At 4:50 AM -0600 11/9/97, J Wunsch wrote:
> >As James Raynard wrote:
> >
> >> Because it's supposed to repeat its arguments instead of parse them?
> >> (with the exception of -n, of course).
> >
> >Tough question: how do you echo a "-n\n" then (without using
> >printf(1), of course)?
> 
> echo -n "-n\
> "

Wrong for sh(1). The newline is swallowed by the shell.
>From the manual page:
"A backslash preceding a \n is treated as a line continuation"

$ echo -n "-n
> "

seems to be an answer to this week's question.

Wolfgang



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199711091519.QAA04460>