Created
January 11, 2019 20:37
-
-
Save namgk/ae9cfff511921ab9cc8f4532622ab5f9 to your computer and use it in GitHub Desktop.
Shell script: remove spaces from file name
This file contains hidden or 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 | |
if [[ $# -eq 0 ]]; then | |
echo "Usage: ./shitspace.sh <folder where spacy files located>" | |
exit 1 | |
fi | |
cd $1 | |
for oldname in * | |
do | |
newname=`echo $oldname | sed -e 's/ /_/g'` | |
mv "$oldname" "$newname" | |
done | |
cd .. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment