Skip to content

Instantly share code, notes, and snippets.

@mmstick
Last active December 27, 2015 16:08
Show Gist options
  • Save mmstick/9002902 to your computer and use it in GitHub Desktop.
Save mmstick/9002902 to your computer and use it in GitHub Desktop.
#!/bin/bash
if [ "$1" == "" ]; then
printf "Enter Season Name: "; read season
else
season="$1"
fi
if [ "$2" == "" ]; then
printf "Enter Season ID : "; read id
else
id="$2"
fi
episodeNum=1
for episode in *.mkv; do
episodeName=$(printf "%s %sx%02d.mkv" "$season" "$id" "$episodeNum")
mv -i -v "$episode" "$episodeName"
let episodeNum+=1
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment