Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: renaming with number prefix
- X-seq: zsh-users 1263
- From: Stephen Marley <stephen@xxxxxxxxx>
- To: zsh-users@xxxxxxxxxxxxxxx
- Subject: Re: renaming with number prefix
- Date: Fri, 23 Jan 1998 17:09:51 +0000
- In-reply-to: <19980123165404.53612@xxxxxxxxxxxxxxxxx>; from Sven Guckes on Fri, Jan 23, 1998 at 04:54:04PM +0100
- References: <19980123165404.53612@xxxxxxxxxxxxxxxxx>
Quoting Sven Guckes (guckes@xxxxxxxxxxxxxxxxx):
> Problem:
> Rename all files within a directory such that their names
> get a numeral prefix in the default sort order.
>
> Btw, "leading zeroes" would be a bonus.
>
i=1; for f in *; do echo mv $f $(echo $i| awk '{ printf("%03d", $0)}').$f; ((i++)); done
remove the first echo to really move files.
--
stephen@xxxxxxxxx
Messages sorted by:
Reverse Date,
Date,
Thread,
Author