From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4087 invoked from network); 27 Oct 1998 03:21:58 -0000 Received: from math.gatech.edu (list@130.207.146.50) by ns1.primenet.com.au with SMTP; 27 Oct 1998 03:21:58 -0000 Received: (from list@localhost) by math.gatech.edu (8.9.1/8.9.1) id WAA00826; Mon, 26 Oct 1998 22:14:54 -0500 (EST) Resent-Date: Mon, 26 Oct 1998 22:14:54 -0500 (EST) From: TGAPE! Message-Id: <199810262202.WAA06805@dal-tsa33-1.cyberramp.net> Subject: Re: Docs fix To: schaefer@brasslantern.com (Bart Schaefer) Date: Mon, 26 Oct 1998 22:02:44 +0000 (GMT) Cc: zsh-workers@math.gatech.edu In-Reply-To: <981026182717.ZM12068@candle.brasslantern.com> from "Bart Schaefer" at Oct 26, 98 06:27:17 pm X-Mailer: ELM [version 2.4 PL25] MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Resent-Message-ID: <"8gn-h1.0.rC.kgJDs"@math> Resent-From: zsh-workers@math.gatech.edu X-Mailing-List: archive/latest/4455 X-Loop: zsh-workers@math.gatech.edu Precedence: list Resent-Sender: zsh-workers-request@math.gatech.edu Bart Schaefer wrote: > > On Oct 26, 7:25pm, Zoltan Hidvegi wrote: >> Subject: Re: Docs fix >>> > The first one is just some stuff for the FAQ about $* vs "$@" >>> >>> The FAQ was correct without this patch. $* and "$@" are equivalent in >>> zsh, unless you run it under Bourne sh or ksh emulation (i.e. with the >>> SH_WORD_SPLIT option set). >> >> Not exactly. "$@" keeps empty arguments and independent of option and >> IFS settings, neither of which is true for $*. > > Yes, but as I was just explaining privately to Phil, the context of his > change is "what zsh construct is most like using \!* in csh aliases?" > > The best answer is $*, because you have to use \!*:q to get "$@" behavior > in csh. An argument could be made that $==* is even better, but not "$@". But, to quote Zoltan, > It's good habbit to use "$@". The use of $* is almost always wrong > in bourne/korn shell scripts still people use that all the time. Who cares if it is the behavior that is most equivalent, when the behavior is not what they want?!? I remember when I was stuck with tcsh, back in the days before zsh became useful, I used to *dream* of having "$@". When I found out ksh had it, I nearly switched, even though I couldn't stand the static user interface. I did switch for all my shell scripts. Showing people how to mimic the broken behavior of their old shells is not necessarily a good way to win converts or friends. However, I do think the FAQ should be modified to mention that no, this isn't the the exact same behavior, this is better. Btw, can you show even *one* case where a csh user really wants $* functionality and not "$@"? And, even if $* by default acted exactly like "$@", it's a good idea to script so as to be complient with as many shells as is reasonable. (That is, going lowest common denominator bites big-time. However, when you have two equivalent ways of doing something, and one is supported in two shells, and one only in zsh, do the multiple shell one. When you get a job where you're politically required to use ksh, you'll be glad you kept up with that practice. Though, I have this annoying tendancy to start scripts with #!/bin/zsh. Doesn't work very well...) Ed the slightly annoyed