Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: All functions are equal...or ?
- X-seq: zsh-users 11198
- From: Frank Terbeck <ft@xxxxxxxxxxxxxxxxxx>
- To: zsh-users@xxxxxxxxxx
- Subject: Re: All functions are equal...or ?
- Date: Thu, 15 Feb 2007 13:14:02 +0100
- In-reply-to: <20070215.043854.25918985.Meino.Cramer@xxxxxx>
- Mail-followup-to: zsh-users@xxxxxxxxxx
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
- Operating-system: Linux 2.6.19.2-suspend2+ipw2200 i686
- References: <20070215.043854.25918985.Meino.Cramer@xxxxxx>
Meino Christian Cramer <Meino.Cramer@xxxxxx>:
[...]
> lww () {
local -a cmdarray
Defining $cmdarray as a local array fixes this problem. $cmdarray
would otherwise be created as a global parameter. I'm setting the
'warncreateglobal' option to be alerted, when I'm doing that myself.
I actually fail to see, _why_ this fixes the problem, yet it does. :-)
[...]
> if [ ! -z $1 ]
> then
> echo
> case `whence -w $1 | cut -d' ' -f 2` in
case ${$(whence -w print)[2]} in
Away with that cut! :)
[...]
> esac
> cmdarray=("${(f)$(whence -pa $1)}")
cmdarray=(${(f)"$(whence -pa $1)"})
Um, this is just the I'm used to write this, which I thought was
accurate. Can someone comment on what the difference between
${(f)"$( foobar )"} and "${(f)$( foobar ) }" is, if there's any?
> echo ${#cmdarray} ## 1
[...]
Regards, Frank
--
In protocol design, perfection has been reached not when there is
nothing left to add, but when there is nothing left to take away.
-- RFC 1925
Messages sorted by:
Reverse Date,
Date,
Thread,
Author