rename_episode.sh
This commit is contained in:
commit
77cfa13698
1 changed files with 25 additions and 0 deletions
25
rename_episode.sh
Normal file
25
rename_episode.sh
Normal file
|
@ -0,0 +1,25 @@
|
||||||
|
echo "Schemes should be a regex of the form (?<=TEXT)\d\d(?=TEXT) where TEXT is uniquely identifying text"
|
||||||
|
read -p "Season Scheme? " sscheme
|
||||||
|
read -p "Episode Scheme? " escheme
|
||||||
|
read -p "Source? " src
|
||||||
|
read -p "Destination? " dest
|
||||||
|
read -p "Series Name? " $name
|
||||||
|
echo "Overrides (leave blank if no override)"
|
||||||
|
read -p "Series? " $so
|
||||||
|
read -p "Episode? " $eo
|
||||||
|
|
||||||
|
for file in "$src/*"; do
|
||||||
|
if [ $so != "" ];then
|
||||||
|
s=$so
|
||||||
|
else
|
||||||
|
s=`echo "$file" | grep -o -P "$sscheme"`
|
||||||
|
fi
|
||||||
|
if [ $eo != "" ];then
|
||||||
|
e=$eo
|
||||||
|
else
|
||||||
|
e=`echo "$file" | grep -o -P "$escheme"`
|
||||||
|
fi
|
||||||
|
ext="${file##*.}"
|
||||||
|
echo 'ln "$src/$file" "$dest/$name.S$s.E$e.$ext"'
|
||||||
|
#ln "$src/$file" "$dest/$name.S$s.E$e.$ext"
|
||||||
|
done
|
Loading…
Add table
Reference in a new issue