Path: utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!att!cbnewsc!danl From: danl@cbnewsc.ATT.COM (daniel.r.levy) Newsgroups: comp.bugs.sys5 Subject: Re: bug in /bin/sh Summary: oops -- ${1+"$@"} better than "$@" Keywords: functions, quotes Message-ID: <1014@cbnewsc.ATT.COM> Date: 25 May 89 23:20:46 GMT References: <883@cetia4.UUCP> <1011@cbnewsc.ATT.COM> Organization: AT&T Bell Laboratories Lines: 16 In article <1011@cbnewsc.ATT.COM> I wrote: < < $ mail() /usr/bin/mailx $* < Use "$@" [sic, including the double quotes] instead of $*. $* re-formats the < arguments into individual tokens. Since you might want to invoke this without arguments at all, use ${1+"$@"} which will expand to nothing if there are no arguments. Otherwise, /usr/bin/mailx will see one null argument if there are no arguments passed to the function, and won't do what you want it to. -- Dan'l Levy UNIX(R) mail: att!ttbcad!levy, att!cbnewsc!danl AT&T Bell Laboratories 5555 West Touhy Avenue Any opinions expressed in the message above are Skokie, Illinois 60077 mine, and not necessarily AT&T's.