#!/usr/bin/perl -w use strict; use File::Find; my $dir = '.'; # or wherever find(\&myrename, $dir); sub myrename { return unless -f and /(.*?)\.abc$/s; my $new_name = $1.".edf"; if (rename $_, $new_name) { print "renamed $File::Find::name to $new_name\n"; } else { warn "Couldn't rename $File::Find::name to $new_name: $!"; } }
In reply to RE: Re: How to do a recursive rename ?
by runrig
in thread How to do a recursive rename ?
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |