Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: more fun with parameter expansion
- X-seq: zsh-users 3177
- From: Clint Adams <schizo@xxxxxxxxxx>
- To: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxxxxxxxxx>
- Subject: Re: more fun with parameter expansion
- Date: Fri, 16 Jun 2000 21:17:34 -0400
- Cc: zsh-users@xxxxxxxxxxxxxx
- In-reply-to: <000616140019.ZM4608@xxxxxxxxxxxxxxxxxxxxxxx>; from schaefer@xxxxxxxxxxxxxxxxxxxxxxx on Fri, Jun 16, 2000 at 02:00:19PM -0700
- Mailing-list: contact zsh-users-help@xxxxxxxxxxxxxx; run by ezmlm
- References: <20000616145330.A8031@xxxxxxxxxxx> <000616140019.ZM4608@xxxxxxxxxxxxxxxxxxxxxxx> <000616144430.ZM4632@xxxxxxxxxxxxxxxxxxxxxxx> <20000616145330.A8031@xxxxxxxxxxx> <000616140019.ZM4608@xxxxxxxxxxxxxxxxxxxxxxx>
> 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