From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14510 invoked from network); 27 Oct 1998 04:28:51 -0000 Received: from math.gatech.edu (list@130.207.146.50) by ns1.primenet.com.au with SMTP; 27 Oct 1998 04:28:51 -0000 Received: (from list@localhost) by math.gatech.edu (8.9.1/8.9.1) id XAA02630; Mon, 26 Oct 1998 23:17:56 -0500 (EST) Resent-Date: Mon, 26 Oct 1998 23:17:56 -0500 (EST) From: "Bart Schaefer" Message-Id: <981026202123.ZM12435@candle.brasslantern.com> Date: Mon, 26 Oct 1998 20:21:23 -0800 In-Reply-To: <199810262202.WAA06805@dal-tsa33-1.cyberramp.net> Comments: In reply to TGAPE! "Re: Docs fix" (Oct 26, 10:02pm) References: <199810262202.WAA06805@dal-tsa33-1.cyberramp.net> X-Mailer: Z-Mail Lite (5.0.0 30July97) To: TGAPE! Subject: Re: Docs fix Cc: zsh-workers@math.gatech.edu MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Resent-Message-ID: <"UdCFJ2.0.1f.qbKDs"@math> Resent-From: zsh-workers@math.gatech.edu X-Mailing-List: archive/latest/4457 X-Loop: zsh-workers@math.gatech.edu Precedence: list Resent-Sender: zsh-workers-request@math.gatech.edu On Oct 26, 10:02pm, TGAPE! wrote: > Subject: Re: Docs fix > > > >> 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 "$@". > > Who cares if it is the behavior that is most equivalent, when the > behavior is not what they want?!? The context here is the question about converting csh aliases to zsh. Csh aliases DO HAVE the equivalent of the "$@" construct. It's \!*:q. If one has a CORRECTLY WORKING ALIAS that uses \!* without the :q, then using "$@" in the replacement zsh function will *NOT* do what one wants, in at least some circumstances. In ANY OTHER CONTEXT, *especially* in shells scripts, everything that is being said about "$@" being better is *absolutely* correct. But it is NOT correct in the FAQ question where Phil's patch changes it! > 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. A zsh function intended to replace a csh alias is not a bourne/korn script. Otherwise I completely agree. > 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. Sigh. Look. The FAQ cannot possibly explain all circumstances in which "$@" is correct. When it's correct, it's better; when it's wrong, it's not better. > Btw, can you show even *one* case where a csh user really wants $* > functionality and not "$@"? Sure. Warning, csh syntax follows. alias do "\!* >&! did &" alias dopr '\!* | lpr -J "\!:1"' If you replace $* with "$@" when converting those aliases, you end up quoting the word in the command position, which causes unexptected side effects. > 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. This is all wonderful advice, but completely out of context for the place that Phil's patch made the change.