From: Zoltan Hidvegi <hzoli@frontiernet.net>
To: zsh-workers@math.gatech.edu (Zsh hacking and development)
Subject: Re: Docs fix
Date: Mon, 26 Oct 1998 23:13:47 -0600 (CST) [thread overview]
Message-ID: <199810270513.XAA19217@hzoli.home> (raw)
In-Reply-To: <981026202123.ZM12435@candle.brasslantern.com> from Bart Schaefer at "Oct 26, 98 08:21:23 pm"
Wow, I did not expect to stir such a debate.
> The context here is the question about converting csh aliases to zsh.
Sure, and you are absolutely right in that \!* corresponds to $*. And
there are certainly legitime cases where you would realy want to use $*.
But the examples in the FAQ are not such cases:
cd() { builtin cd $*; echo $PWD; }
rm() { command rm -i $* }
l() { /bin/ls -la $* | more }
In all these cases you really want to use "$@". Especially in case of
cd, I often use the two argument cd with empty second argument. There is
a good example in the FAQ where $* is the right thing:
xhead () { print -n "\033]2;$*\a"; }
And one more point, people misuse csh's \!* as often as they do misuse
$*.
> 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.
This really does not have any relevance to this discussion, but what are
those side effects? Alias expansion and reserved word recognition is not
done on the result of either $* or "$@" expansion. The exact conversion
of these csh aliases would be rather tricky.
Zoli
next prev parent reply other threads:[~1998-10-27 5:16 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
1998-10-26 23:03 Phil Pennock
1998-10-26 23:53 ` Bart Schaefer
1998-10-27 1:25 ` Zoltan Hidvegi
1998-10-27 2:27 ` Bart Schaefer
1998-10-26 22:02 ` TGAPE!
1998-10-27 4:05 ` Phil Pennock
1998-10-27 4:21 ` Bart Schaefer
1998-10-27 5:13 ` Zoltan Hidvegi [this message]
1998-10-28 4:53 ` Bart Schaefer
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=199810270513.XAA19217@hzoli.home \
--to=hzoli@frontiernet.net \
--cc=zsh-workers@math.gatech.edu \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/zsh/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).