Skip to main content

skip to main content

developerWorks  >  Linux  >

Cultured Perl: One-liners 101

Perl as a command-line utility

developerWorks

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