diff --git a/wanted/search-wanted.sh b/wanted/search-wanted.sh index 4c9c0c4..e7dfd57 100755 --- a/wanted/search-wanted.sh +++ b/wanted/search-wanted.sh @@ -3,15 +3,18 @@ declare WANTED_FILE=`dirname $0`/subs.wanted declare MISSED="" +echo "###### Process started at: $(date) ######" while read -r line; do - MAP_ARRAY=($(echo "$line" | sed "s/:/ /g")) + IFS=':' + MAP_ARRAY=($(echo "$line")) SOURCE=${MAP_ARRAY[0]} SRT=${MAP_ARRAY[1]} LANG=`echo $SRT | sed -e "s/\.srt//g" -e "s/.*\(..\)/\1/"` echo "subliminal download -l $LANG $SOURCE" subliminal download -l $LANG $SOURCE if [[ ! -f $SRT ]]; then + IFS='' MISSED="$SOURCE:$SRT\n$MISSED" echo "Subtitle still not available" else