#!/bin/sh find ${1+"$@"} -depth -print0 | xargs -0r rename ' my ($dir, $base) = m#^(.*/)?([^/]+)$#; $dir = "" unless defined($dir); $base =~ s/%20/_/g; $base =~ tr/A-Z ()[]/a-z_____/; $base =~ tr/#!'\''//d; $base =~ s/_&_/_and_/g; $base =~ s/&/_and_/g; $_ = "$dir$base";'