On Fri, Apr 20, 2001 at 08:15:59AM -0500, Jim Baxter a ecrit:
> Hi
>
> Is there a way to rename all the files in a directory the end with .123
> to end with .src ?
Several, actually:
You can use the rename program from the util-linux rpm and use it:
rename ".123" ".src" *.123
You can use Larry Wall's rename script, written in Perl:
#!/usr/bin/perl -w
# rename - Larry's filename mixer
$op = shift or die "Usage: rename expr [files]\n";
chomp(@ARGV = <STDIN>) unless @ARGV;
for (@ARGV) {
$was = $_;
eval $op;
die $@ if$@;
rename($was,$_) unless $was eq $_;
}
rename "s/123$/src/" *.123
Emmanuel Seyman
_______________________________________________
Redhat-list mailing list
[EMAIL PROTECTED]
https://listman.redhat.com/mailman/listinfo/redhat-list