🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: net.bugs.usg
Article #277

Re: getopt(1) doesn't/can't preserve quoted args

#277
From: Doug Gwyn
Date: Mon, 03 Mar 1986 07:39
17 lines
1498 bytes
In a paper entitled "An Enhanced Getopt", T. C. Jones and L. A. Kennedy
of AT&T Bell Laboratories undertook an overhaul of getopt(1) and getopt(3C)
to support the Command Syntax Standard.  They proposed altering the usage
of getopt(1) from the current
	set -- `getopt ops $*`
to
	eval set -- "`getopt ops "$@"`"
in order to avoid the extra IFS argument splitting.  In order for this
proposal to work, a shell bug (handing of $@ when no arguments exist)
needs to be fixed.

Their proposal has one serious design botch, however:  The new form of
getopt(1) cannot be upward-compatible with the current version!  This
should be avoided by calling the new utility something like "getopts"
while continuing to provide a "getopt" with the old semantics during a
transition period.  I hope this mistake is fixed before we all end up
having our existing shell scripts break on "flag day".
Technical Details
Message-ID: <1443@brl-smoke.ARPA>
Path: arc1-ca.pugleaf.net!utzoo!watmath!clyde!burl!ulysses!bellcore!decvax!genrad!panda!talcott!harvard!seismo!brl-adm!brl-smoke!gwyn
References: <152@babel.UUCP>

Show Full Headers
Complete Article Headers
Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Path: arc1-ca.pugleaf.net!utzoo!watmath!clyde!burl!ulysses!bellcore!decvax!genrad!panda!talcott!harvard!seismo!brl-adm!brl-smoke!gwyn
From: gwyn@brl-smoke.ARPA (Doug Gwyn )
Newsgroups: net.bugs.usg
Subject: Re: getopt(1) doesn't/can't preserve quoted args
Message-ID: <1443@brl-smoke.ARPA>
Date: Mon, 3-Mar-86 02:39:12 EST
Article-I.D.: brl-smok.1443
Posted: Mon Mar  3 02:39:12 1986
Date-Received: Wed, 5-Mar-86 04:16:30 EST
References: <152@babel.UUCP>
Reply-To: gwyn@brl.ARPA
Distribution: net
Organization: Ballistic Research Lab (BRL)
Lines: 17