Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: In the tla completion function: "${(@P)var_cmd-*:FILE:_files}"
- X-seq: zsh-users 7891
- From: Haakon Riiser <haakon.riiser@xxxxxxxxxx>
- To: zsh-users@xxxxxxxxxx
- Subject: Re: In the tla completion function: "${(@P)var_cmd-*:FILE:_files}"
- Date: Fri, 20 Aug 2004 10:55:46 +0200
- In-reply-to: <20040817005205.GB2869@xxxxxxx>
- Mail-followup-to: zsh-users@xxxxxxxxxx
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
- References: <20040816213204.GA6795@s> <20040817005205.GB2869@xxxxxxx>
[Jason McCarty]
> > if $var_cmd is not defined, I'd expect the expansion to give the
> > string after the '-':
>
> $var_cmd is always defined to something of the form "cmd_*" on line 658.
> I believe the P flag is evaluated before the - expansion, although I
> don't see an explicit mention of it in the manpage. The variable named
> by $var_cmd may or may not be defined, which is where the - expansion
> comes into play.
>
> I'm afraid I came up with many of my fancy substitutions by trial and
> error ;-)
Hmm, strange that my shell gives 'bad substitution' when var_cmd
is not defined.
% unset var_cmd
% echo "${(@P)var_cmd-*:FILE:_files}"
zsh: bad substitution
In your case, the result is
% unset var_cmd
% echo "${(@P)var_cmd-*:FILE:_files}"
*:FILE:_files
Right?
--
Haakon
Messages sorted by:
Reverse Date,
Date,
Thread,
Author