X-Git-Url: https://git.rmz.io/dotfiles.git/blobdiff_plain/04fed8e4657d28df3ca947ea34c2a5d8f9ccc02f..61d7dd11d4a450a64f2817ee4db0ec7fa5880b42:/bin/old/old_addName?ds=sidebyside diff --git a/bin/old/old_addName b/bin/old/old_addName new file mode 100755 index 0000000..35b9ba7 --- /dev/null +++ b/bin/old/old_addName @@ -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