Skip to content

Instantly share code, notes, and snippets.

@zhanang19
Created June 18, 2021 06:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zhanang19/4dd618ad7d788e8264dfaea693475db9 to your computer and use it in GitHub Desktop.
Save zhanang19/4dd618ad7d788e8264dfaea693475db9 to your computer and use it in GitHub Desktop.
#!/bin/bash
for f in *
do
new="${f//_/ }"
if [ "$new" != "$f" ]
then
if [ -e "$new" ]
then
echo not renaming \""$f"\" because \""$new"\" already exists
else
echo moving "$f" to "$new"
mv "$f" "$new"
fi
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment