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

Re: foo(:...) and foo~ glob



> On May 2,  3:27pm, Zoltan Hidvegi wrote:
> } Subject: foo(:...) and foo~ glob
> }
> } After this change:
> } 
> } Sun Apr  5 20:00:40 1998  Andrew Main  <zefram@xxxxxxxx>
> } 
> } the (:quals) syntax no longer works.
> 
> Does this also mean that either/both of the following are broken?
> 
> 	echo ${pref}**/CVS(:h) | sed 's/CVS//'
> 
> 	case $(tty)(:t) in

Perhaps I was not very clear.  Both of these works.  The (:...) syntax
triggers globbing, which means it does not work on words which are not
existing filenames.  The later $(tty)(:t) example works differently than
before, although you'll not notice it: zsh now looks at the disk if the
result of tty exists before applying the qualifier, while before the
qualifier was applied unconditionally.  Since ttyp gives you an existing
device, this does not make any difference here.  The difference is in
things like

echo asdfg(:s/g/h/)

gives you

zsh: no matches found: asdfg(:s/g/h/)

instead of asdfh if you do not have a file called asdfg in your current
directory.  Zefram is right in that the old behaviour was not very well
documented, which is really my fault, since I added this in 2.6-beta20.

Zoli



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