Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: 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 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".