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

Why does this extended glob pattern fail?



In my zsh script, I want to copy all files from a directory, except
files ending in .log and .png. This is my code:

....
setopt extendedglob # makes ^ work in glob pattern
cp ^$from/*.{log,png} $dest
....

However, there are cases when $from has neither .log nor .png files; but
it DOES contain other files. In this case I get the error message

   no matches found: ^/home/...../*.log

I think this has to do with the timing of when interpretation of {....}
and when globbing is done. Why exactly do I get the error message, and
how do I code this correctly?

Im using zsh 4.2.

Ronald

-- 
Ronald Fischer <ronaldf@xxxxxx>
+  If a packet hits a pocket on a socket on a port, 
+  and the bus is interrupted and the interrupt's not caught,
+  then the socket packet pocket has an error to report.
+		(cited after Peter van der Linden)



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