From owner-freebsd-hackers Sun Nov 9 10:50:36 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.7/8.8.7) id KAA27611 for hackers-outgoing; Sun, 9 Nov 1997 10:50:36 -0800 (PST) (envelope-from owner-freebsd-hackers) Received: from sax.sax.de (sax.sax.de [193.175.26.33]) by hub.freebsd.org (8.8.7/8.8.7) with SMTP id KAA27599 for ; Sun, 9 Nov 1997 10:50:30 -0800 (PST) (envelope-from j@uriah.heep.sax.de) Received: (from uucp@localhost) by sax.sax.de (8.6.12/8.6.12-s1) with UUCP id TAA09498 for freebsd-hackers@FreeBSD.ORG; Sun, 9 Nov 1997 19:50:29 +0100 Received: (from j@localhost) by uriah.heep.sax.de (8.8.7/8.8.5) id TAA00491; Sun, 9 Nov 1997 19:39:36 +0100 (MET) Message-ID: <19971109193935.QU33958@uriah.heep.sax.de> Date: Sun, 9 Nov 1997 19:39:35 +0100 From: j@uriah.heep.sax.de (J Wunsch) To: freebsd-hackers@FreeBSD.ORG Subject: Re: Why doesn't /bin/echo use getopt? References: <19971109115007.JB56482@uriah.heep.sax.de> X-Mailer: Mutt 0.60_p2-3,5,8-9 Mime-Version: 1.0 X-Phone: +49-351-2012 669 X-PGP-Fingerprint: DC 47 E6 E4 FF A6 E9 8F 93 21 E0 7D F9 12 D6 4E Reply-To: joerg_wunsch@uriah.heep.sax.de (Joerg Wunsch) In-Reply-To: ; from David E. Cross on Nov 9, 1997 10:51:17 -0500 Sender: owner-freebsd-hackers@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk As David E. Cross wrote: > for echo: > echo -- -n\n > > That would work with getopt(3). ...but not with /bin/echo, that's why i was asking. j@uriah 54% /bin/echo -- '-n\n' -- -n\n OTOH, if you were asking for getopt, consider: j@uriah 55% /bin/echo "- today's a great day -" - today's a great day - vs. the getopt(3)ified version: j@uriah 56% /tmp/echo/echo "- today's a great day -" echo: illegal option -- echo: illegal option -- t echo: illegal option -- o echo: illegal option -- d echo: illegal option -- a echo: illegal option -- y echo: illegal option -- ' echo: illegal option -- s echo: illegal option -- echo: illegal option -- a echo: illegal option -- echo: illegal option -- g echo: illegal option -- r echo: illegal option -- e echo: illegal option -- a echo: illegal option -- t echo: illegal option -- echo: illegal option -- d echo: illegal option -- a echo: illegal option -- y echo: illegal option -- -- cheers, J"org joerg_wunsch@uriah.heep.sax.de -- http://www.sax.de/~joerg/ -- NIC: JW11-RIPE Never trust an operating system you don't have sources for. ;-)