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

Re: more fun with parameter expansion



> >   zmv '(**/)(*)' '${1}${(L)2// /_}'
> 
> MARK_DIRS raises its ugly head again.  Changing the odon's to
> odon^M made it work as advertised.

I scratched my head over this until I released `emulate -L zsh' doesn't set
MARK_DIRS, which is a pretty shoddy trick given all the sorts of things
expansions in shell functions do nowadays and I've a good mind to change
it.  I can't think of a good example where that would be wrong.

I've just seen a nasty problem if you do something like
  zmv -Q '(**/)(*)(^/)'
since you get the effect of ^odon and the original problem comes back.  I
won't tackle this now, however.

Index: Functions/Misc/zmv
===================================================================
RCS file: /cvsroot/zsh/zsh/Functions/Misc/zmv,v
retrieving revision 1.3
diff -u -r1.3 zmv
--- Functions/Misc/zmv	2000/06/19 09:13:45	1.3
+++ Functions/Misc/zmv	2000/06/20 09:05:30
@@ -115,7 +115,7 @@
 #   non-positional parameters may not start with a number, although
 #   paranoiacs like the author will probably put them there anyway.
 
-emulate -L zsh
+emulate -RL zsh
 setopt extendedglob
 
 local f g args match mbegin mend files action myname tmpf opt exec

-- 
Peter Stephenson <pws@xxxxxxxxxxxxxxxxxxxxxxxxx>
Cambridge Silicon Radio, Unit 300, Science Park, Milton Road,
Cambridge, CB4 0XL, UK                          Tel: +44 (0)1223 392070



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