Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/perl
- chdir("merge");
- my @files = split /\n/, `ls -tr`;
- $c = 1;
- foreach(@files) {
- $old = $_;
- s/^\d+//;
- $_ = sprintf('%03d%s', $c++, $_);
- $cmd = "mv \"$old\" \"$_\"";
- print "$cmd\n";
- `$cmd`;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement