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

Re: need help with compctl for NT



Amol Deshpande wrote:

> I came up with a completion that seems to work:
> 
>      'c[-1,stop]' -s "$(net.exe start|grep.exe -v ^T|sed.exe -ne
> 's/\([A-Z][a-zA
> -Z].*\)/"\1"/p')" \
> 
> 
> The only problem is that this completion only collects the output of "net
> start"
> on shell startup.  I would like the list to be updated every time i run "net
> stop ..."

Simply change the double quotes around the $(...) to single quotes (and
anywhere else affected by the change in quotation marks, of course).  With
the double quotes, the $(...) is getting evaluated straight away; with
single quotes it will be stored as a complete string, and expanded
separately each time.  At least, it looks that simple...

-- 
Peter Stephenson <pws@xxxxxxxxxxxxxxxxx>       Tel: +39 050 844536
WWW:  http://www.ifh.de/~pws/
Dipartimento di Fisica, Via Buonarroti 2, 56127 Pisa, Italy



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