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

Re: more fun with parameter expansion



> Oh, and your solution missed file names that began with a dot, unless you
> meant to say that both MARK_DIRS and GLOB_DOTS were needed ...

No, I didn't.  I hadn't considered dotfiles, actually.

> The correct solution is
> 
> for f in **/*(DNOn^M); do
>   mv -v $i ${${(M)i%/*}:+${i%/*}}${${${(M)i%/*}:-$i}:l:gs/ /_/}
> done

Of course, you meant to change all the i's to f's or the f to an i.

Thanks for the shorter version.



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