Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/18/84 SMI; site sun.uucp Path: utzoo!watmath!clyde!burl!ulysses!gamma!epsilon!zeta!sabre!petrus!bellcore!decvax!decwrl!sun!david From: david@sun.uucp (David DiGiacomo) Newsgroups: net.unix-wizards Subject: Re: Problems with System V Release 2.1 on 68010 Message-ID: <3514@sun.uucp> Date: Wed, 16-Apr-86 13:15:14 EST Article-I.D.: sun.3514 Posted: Wed Apr 16 13:15:14 1986 Date-Received: Fri, 18-Apr-86 08:26:12 EST References: <401@oscvax.UUCP> <412@hropus.UUCP> Reply-To: david@sun.uUCp (David DiGiacomo) Organization: Sun Microsystems, Inc. Lines: 18 In article <412@hropus.UUCP> ka@hropus.UUCP (Kenneth Almquist) writes: >> 4) Is it true that the sh construct "$@" (in a shell script) is supposed >> to be identically equal to the command-line arguments? It seems that >> it should, because otherwise there is no way to get at these because >> $@ = $* gets reparsed, and "$*" is one word. >> In our sh, "$@" is exactly equivalent to the command line args if there >> are some, otherwise it is equal to "" instead of nothing. >> Seems like a bug to me. If so, how wide-spread is it? > >It's on our SVR2 on a VAX here. The Korn shell gets this right, of course. This also afflicts SunOS 3.0. I find it incredibly annoying, but a simple workaround is to use ${1+"$@"} instead of plain "$@". [disclaimer] -- David DiGiacomo {decvax, ihnp4, ucbvax}!sun!david david@sun.arpa Sun Microsystems, Mt. View, CA (415) 960-7495