Skip to content

Instantly share code, notes, and snippets.

@unimonkiez
Created November 24, 2019 23:18
Show Gist options
  • 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