Skip to content

Instantly share code, notes, and snippets.

@unimonkiez
Created November 24, 2019 23:18
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 unimonkiez/3ce9a1dd39c1ded5181631befbd08827 to your computer and use it in GitHub Desktop.
Save unimonkiez/3ce9a1dd39c1ded5181631befbd08827 to your computer and use it in GitHub Desktop.
#!/bin/bash
#source ~/.my_custom_commands.sh
function rename-folder() {
for f in *.*; do
newname=`echo "$f" | sed -E "s/$1/$2/g"`
if [ $3 == 'do' ]
then
mv "$f" "$newname"
else
echo "$newname"
fi
done
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment