zsh-users
 help / color / mirror / code / Atom feed
* Why does this extended glob pattern fail?
@ 2011-07-27 13:53 Ronald Fischer
  2011-07-27 14:11 ` Mikael Magnusson
  2011-07-27 14:32 ` Stephane Chazelas
  0 siblings, 2 replies; 6+ messages in thread
From: Ronald Fischer @ 2011-07-27 13:53 UTC (permalink / raw)
  To: zsh-users

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@eml.cc>
+  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)


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2011-08-01 13:24 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-07-27 13:53 Why does this extended glob pattern fail? Ronald Fischer
2011-07-27 14:11 ` Mikael Magnusson
2011-07-27 14:32 ` Stephane Chazelas
2011-08-01 10:20   ` Ronald Fischer
2011-08-01 11:04     ` Peter Stephenson
2011-08-01 13:24     ` ZyX

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).