Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10 5/3/83; site ulysses.UUCP Path: utzoo!linus!decvax!harpo!floyd!whuxlb!pyuxll!eisx!npoiv!npois!hogpc!houxm!ihnp4!cbosgd!ulysses!dgk From: dgk@ulysses.UUCP Newsgroups: net.unix-wizards,btl.unix Subject: Re: "$@ in shell" Message-ID: <564@ulysses.UUCP> Date: Mon, 22-Aug-83 09:39:46 EDT Article-I.D.: ulysses.564 Posted: Mon Aug 22 09:39:46 1983 Date-Received: Mon, 22-Aug-83 20:34:17 EDT References: <358@mhtsa.UUCP>, <556@ulysses.UUCP> Organization: Bell Labs, Murray Hill Lines: 25 I have received mail from a few who think that the Bourne shell is correct in the expansion of "$@". They rest their case on the line in the manual page under Blank Interpretation, "Implicit null arguments ( those resulting from parameter that have no values) are removed." However, in the section on quoting it says that "$@" is equivalent to "$1" "$2" ... . If a shell script, script, consisting of the lines for i in "$@" do echo "$i" done for i in "$1" "$2" "$3" do echo "$i" done is invoked as: script 'line one' '' 'line three' then the statement about quoting implies that the output should be: line one line three line one line three The reason the rule on Blank Interpretation does not apply is the $2 was an explicit null argument, not an implicit one.