Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: setopt and alias questions
- X-seq: zsh-users 2128
- From: Phil Pennock <comet@xxxxxxxx>
- To: zsh-users@xxxxxxxxxxxxxx
- Subject: Re: setopt and alias questions
- Date: Tue, 9 Feb 1999 08:40:34 +0000
- In-reply-to: <990208123047.ZM14645@xxxxxxxxxxxxxxxxxxxxxxx>; from "Bart Schaefer" on Mon 8 Feb 1999 (12:30 -0800)
- Mail-followup-to: zsh-users@xxxxxxxxxxxxxx
- Mailing-list: contact zsh-users-help@xxxxxxxxxxxxxx; run by ezmlm
- Organisation: Organisation? Here? No, over there ---->
- References: <19990207193735.A2060@xxxxxxxxxxxxxxxxxxxx> <990207175931.ZM8940@xxxxxxxxxxxxxxxxxxxxxxx> <19990207235214.A2653@xxxxxxxxxxxxxxxxxxxx> <990207233343.ZM10079@xxxxxxxxxxxxxxxxxxxxxxx> <19990208103038.A3447@xxxxxxxxxxxxxxxxxxxx> <990208104550.ZM14297@xxxxxxxxxxxxxxxxxxxxxxx> <19990208141534.A4151@xxxxxxxxxxxxxxxxxxxx> <19990208144623.B4151@xxxxxxxxxxxxxxxxxxxx> <990208123047.ZM14645@xxxxxxxxxxxxxxxxxxxxxxx>
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