Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save rkfg/eb1e7946616f7fdddd98 to your computer and use it in GitHub Desktop.
Save rkfg/eb1e7946616f7fdddd98 to your computer and use it in GitHub Desktop.
#!/bin/sh
FLAGS=-v
if [ "$1" = "-n" ]
then
FLAGS="$1"
shift
fi
rename $FLAGS 's#(^\[[^]]*\])[ _]?(.+?)(\.([a-zA-Z0-9]*$)|$)#$2 $1$3#' "$@"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment