]> git.rmz.io Git - dotfiles.git/blobdiff - bin/old/old_addName
merge bin from shada
[dotfiles.git] / bin / old / old_addName
diff --git a/bin/old/old_addName b/bin/old/old_addName
new file mode 100755 (executable)
index 0000000..35b9ba7
--- /dev/null
@@ -0,0 +1,27 @@
+#! /bin/bash
+
+##
+# This script adds the name of the episode by parsing the list taken from epguides.com
+# shortend to only contain the episodes of the current season in a specific text File.
+# This file has to start with the first episode.
+# All the video files have to be in chronological order.
+#
+# I definitely need to learn Perl to do a better script!!!
+##
+
+episode=1;
+for file in *.avi; do
+       line=$(awk 'FNR == "'"$episode"'"' season1.txt);
+       
+       name=${line:39};
+       
+       if [ ${#episode} -eq 1 ]; then
+               newname="Scrubs 8x0${episode} $name.avi";
+       else
+               newname="Scrubs 8x${episode} $name.avi";
+       fi;
+       #cp "$file" "$newname";
+       echo $newname;
+               
+       episode=$(( $episode + 1 ));
+done