Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Another patch to compctl-examples CVS compctl, and a bug?
- X-seq: zsh-workers 1643
- From: Zoltan Hidvegi <hzoli@xxxxxxxxxx>
- To: schaefer@xxxxxxx
- Subject: Re: Another patch to compctl-examples CVS compctl, and a bug?
- Date: Mon, 15 Jul 1996 03:02:23 +0200 (MET DST)
- Cc: zsh-workers@xxxxxxxxxxxxxxx
- In-reply-to: <960713173425.ZM5697@xxxxxxxxxxxxxxxxxxxxxxx> from Bart Schaefer at "Jul 13, 96 05:34:22 pm"
- Organization: Dept. of Comp. Sci., Eotvos University, Budapest, Hungary
- Phone: (36 1)2669833 ext: 2667, home phone: (36 1) 2752368
> It's now possible to avoid several external processes in generating the
> list of CVS-controlled files in the `cvstargets' function. The key is
> this wonderful "parameter" (boy, is that misnamed) subsitution:
>
> "${${${(f@)$({<${pref}CVS/Entries} 2>/dev/null)}#/}%%/*}"
There are two problems with that. First I've modified the lexer so that
!, [[, { and } are reserved words now. This means that these must be
delimited. So {echo} no longer works, { echo } should be used instead.
Similarily [[-z $foo]] does not work, [[ -z $foo ]] should be used.
The other problem is that this depends on READNULLCMD being cat.
$(<...) always works since it is always recognized as a special command
substitution. That's why the 2> redirection does not work in that case
(but a space between `(' and `<' fixes that problem).
> If there's a better way than `for f in ... do echo ... done' to prefix
> every element of the resulting array with ${pref}, I'd love to see it.
It's simply
"${pref}${^${${(f@)$({<${pref}CVS/Entries} 2>/dev/null)}#/}%%/*}"
> works fine. However, if no CVS directory exists at all, the above
> subsitution prints a newline to the terminal -- which messes up zle.
Are you sure that there is not empty element in the reply? The above
`parameter expansion' always produces at least one element.
Zoltan
Messages sorted by:
Reverse Date,
Date,
Thread,
Author