]> git.donarmstrong.com Git - bin.git/blob - sanitize_filename
41f8b39cebb0281e415d8809559361cffec5dbec
[bin.git] / sanitize_filename
1 #! /bin/sh
2 # replace spaces with underscores, lowercase everything, ditch multiple underscores, and ditch _.foo.
3 # should probably try to avoid overwriting existing files, but c'est la vie!
4 rename 's/\s+/\_/g; $_ = lc($_); s/\_+/\_/g; s/\_\././' "$@"