Cultured Perl: One-liners 101

Perl as a command-line utility

Return to article

Listing 3. Renaming files from aaa to bbb
> find . | perl -ne'chomp; next unless -e; $oldname = $_; s/aaa/bbb/; next if -e; rename $oldname, $_'

Return to article