Created
May 5, 2014 02:36
-
-
Save michaelrhodes/214bd13c76a95d9de090 to your computer and use it in GitHub Desktop.
slugify the files of your working directory
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
for file in $(pwd)/* | |
do | |
result=$(echo $(basename $file | tr 'A-Z' 'a-z') | tr ' ' '-') | |
mv "$file" $result | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment