in reply to Monitoring file names for changes in extension
#!/usr/bin/perl my $dir = shift or die "need a directory name"; opendir my $fd, $dir or die $!; for ( readdir $fd ) { next unless /\.AU~$/; my $old = "$dir/$_"; next unless -f $old; ( my $new = $old ) =~ s/~$/W/; rename $old => $new unless -e $new; } closedir $fd; #thx fletch
|
|---|