From owner-freebsd-hackers Sun Nov 9 07:19:23 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.7/8.8.7) id HAA15679 for hackers-outgoing; Sun, 9 Nov 1997 07:19:23 -0800 (PST) (envelope-from owner-freebsd-hackers) Received: from rvc1.informatik.ba-stuttgart.de (rvc1.informatik.ba-stuttgart.de [141.31.112.22]) by hub.freebsd.org (8.8.7/8.8.7) with ESMTP id HAA15674 for ; Sun, 9 Nov 1997 07:19:18 -0800 (PST) (envelope-from helbig@Informatik.BA-Stuttgart.DE) Received: (from helbig@localhost) by rvc1.informatik.ba-stuttgart.de (8.8.7/8.8.5) id QAA04460; Sun, 9 Nov 1997 16:19:09 +0100 (MET) From: Wolfgang Helbig Message-Id: <199711091519.QAA04460@rvc1.informatik.ba-stuttgart.de> Subject: Re: Why doesn't /bin/echo use getopt? In-Reply-To: from Richard Wackerbarth at "Nov 9, 97 05:17:39 am" To: rkw@dataplex.net (Richard Wackerbarth) Date: Sun, 9 Nov 1997 16:19:08 +0100 (MET) Cc: joerg_wunsch@uriah.heep.sax.de, freebsd-hackers@FreeBSD.ORG X-Mailer: ELM [version 2.4ME+ PL30 (25)] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-freebsd-hackers@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk > 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