Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 9 Nov 1997 10:51:17 -0500 (EST)
From:      "David E. Cross" <dec@phoenix.its.rpi.edu>
To:        Joerg Wunsch <joerg_wunsch@uriah.heep.sax.de>
Cc:        freebsd-hackers@FreeBSD.ORG
Subject:   Re: Why doesn't /bin/echo use getopt?
Message-ID:  <Pine.BSF.3.96.971109104957.6497A-100000@phoenix.its.rpi.edu>
In-Reply-To: <19971109115007.JB56482@uriah.heep.sax.de>

next in thread | previous in thread | raw e-mail | index | archive | help
On Sun, 9 Nov 1997, 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)?


The same way you rm(1) a file named -rf/?
rm -- -rf/

for echo:
echo -- -n\n

That would work with getopt(3).

--
David Cross
ACS Consultant




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.3.96.971109104957.6497A-100000>