Cultured Perl: One-liners 101

Perl as a command-line utility

Return to article

Listing 11. Renaming JPG files
> find . -name "*.jpg" | perl -ne'chomp; $name = $_; $quote = chr(39); s/[$quote\\!]/_/ ; print "mv \"$name\" \"$_\"\n"'

Return to article