Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!seismo!elsie!ado From: ado@elsie.UUCP (Arthur David Olson) Newsgroups: comp.unix.questions Subject: Re: $@ vs. $* Message-ID: <7297@elsie.UUCP> Date: Tue, 16-Dec-86 11:32:48 EST Article-I.D.: elsie.7297 Posted: Tue Dec 16 11:32:48 1986 Date-Received: Wed, 17-Dec-86 18:38:22 EST References: <181@haddock.UUCP> <106@quacky.UUCP> <164@its63b.ed.ac.uk> Organization: NIH-LEC, Bethesda, MD Lines: 29 Keywords: sh, positional parameters Summary: Don't change $@--add something new The problem: you set up a one-line "sh" script named "feline" that reads c "$@" hoping that you can then use the command "c" rather than "cat". But things go awry if you grep uucp /etc/passwd | c Another poster's earlier posting: a fix to "sh" to handle "$@" the way it "ought" to be handled, with a wise caution that scripts relying on the fixed sh's handling of "$@" won't be portable. My notion: instead of changing the behavior of "$@", introduce a new '$' sequence that does what "$@" ought to do--for example, set things up so that cat "${" does what ought to be done by cat "$@" The advantage of doing this: if a cat "${" script is run on an "old" shell, you'll get a bad substition error rather than getting the incorrect results. The "old" shell will have recognized that you've asked it to do something it doesn't know how to do. -- UUCP: ..decvax!seismo!elsie!ado ARPA: elsie!ado@seismo.ARPA DEC, VAX, Elsie & Ado are Digital, Borden & Ampex trademarks.