Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: renaming with number prefix
- X-seq: zsh-users 1275
- From: Ulrich Pfeifer <pfeifer@xxxxxxx>
- To: ZShell Users <zsh-users@xxxxxxxxxxxxxxx>
- Subject: Re: renaming with number prefix
- Date: 23 Jan 1998 22:47:19 +0100
- In-reply-to: Sven Guckes's message of "Fri, 23 Jan 1998 16:54:04 +0100"
- References: <19980123165404.53612@xxxxxxxxxxxxxxxxx>
>>>>> "Sven" == Sven Guckes <guckes@xxxxxxxxxxxxxxxxx> writes:
Sven> Problem:
Sven> Rename all files within a directory such that their names
Sven> get a numeral prefix in the default sort order.
Sven> Example:
Sven> $ ls
Sven> abc bar baz foo zyxxy
Sven> $ <command>
Sven> $ ls
Sven> 1.abc 2.bar 3.baz 4.foo 5.zyxxy
Sven> So - what's that <command>?
perl -e 'map rename($_, ++$i.".".$_), @ARGV' *
Sven> Btw, "leading zeroes" would be a bonus.
perl -e 'map rename($_, sprintf "%03d.%s",++$i,$_), @ARGV' *
Ulrich Pfeifer
--
OK, I could change the source, but I'd rather not, besides looking
at it makes my head hurt
--Richard Caley speaking about the freeWAIS-sf sources
Messages sorted by:
Reverse Date,
Date,
Thread,
Author