Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: setopt and alias questions



Typing away merrily, Bart Schaefer produced the immortal words:
> }    if [[ -n $@ ]] ; then
> }       listalloptions | egrep "${@:s/ /|/}"
> }    else listalloptions
> }    fi;
> 
> That doesn't work, does it?
> 
>     zsh% argv=(x y z)
>     zsh% print -l "${@:s/ /|/}"
>     x
>     y
>     z
>     zsh% print -l "${(j:|:)@}"
>     x|y|z
>     zsh% print -l "${*:gs/ /|/}"
>     x|y|z

That last one is dependent upon the first character of $IFS being a
space and is perhaps, IMnsHO, not suited for use in a function?

Nice though.
-- 
--> Phil Pennock ; GAT d- s+:+ a23 C++(++++) UL++++/I+++/S+++/B++/H+$ P++@$
L+++ E-@ W(+) N>++ o !K w--- O>+ M V !PS PE Y+ PGP+ t-- 5++ X+ R !tv b++>+++
DI+ D+ G+ e+ h* r y?



Messages sorted by: Reverse Date, Date, Thread, Author