]> git.rmz.io Git - dotfiles.git/blob - bin/old/old_addName
merge bin from shada
[dotfiles.git] / bin / old / old_addName
1 #! /bin/bash
2
3 ##
4 # This script adds the name of the episode by parsing the list taken from epguides.com
5 # shortend to only contain the episodes of the current season in a specific text File.
6 # This file has to start with the first episode.
7 # All the video files have to be in chronological order.
8 #
9 # I definitely need to learn Perl to do a better script!!!
10 ##
11
12 episode=1;
13 for file in *.avi; do
14 line=$(awk 'FNR == "'"$episode"'"' season1.txt);
15
16 name=${line:39};
17
18 if [ ${#episode} -eq 1 ]; then
19 newname="Scrubs 8x0${episode} $name.avi";
20 else
21 newname="Scrubs 8x${episode} $name.avi";
22 fi;
23 #cp "$file" "$newname";
24 echo $newname;
25
26 episode=$(( $episode + 1 ));
27 done