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

Re: Trouble with zmv and extended globs



On Oct 18,  7:27pm, Dan Bullok wrote:
} varying depths, I try:
} 	zmv -n '(**/con*)(#qe,file ${REPLY}|grep "python script",)' '$1.py'
} which gives me the following error:
} 	zmv:238: bad pattern: (*/*)(#qe,file ${REPLY}|grep python,)

Philippe's answer was almost the correct one.

** is not a shortcut for (*/)#.  **/ is a shortcut for (*/)#.  The slash
must be there, and must immediately follow the two stars, and there must
not be anything but a slash [or open paren] preceding the two stars, or
they do not have special meaning (and are the same as one star).

In fact, Philippe's second example should work:

  zmv -n '(*/)#(con*)(#qe,file ${REPLY}|grep "python script",)' '$1$2.py'

As should:

  zmv -n '(**/)(con*)(#qe,file $REPLY | grep "python script",)' '$1$2.py'

You might want to use "grep -q", though.



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