Last active
October 13, 2015 20:48
-
-
Save jktravis/4254304 to your computer and use it in GitHub Desktop.
Pipe in or supply a single filename to remove the spaces
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
#!/bin/bash | |
# Replace spaces with underscores | |
for file in "${1}"; | |
do | |
echo Renaming "$file" to "${file// /_}" | |
mv "$file" "${file// /_}" | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment