X-Git-Url: https://feistymeow.org/gitweb/?a=blobdiff_plain;f=scripts%2Fshow_db%2Fmovie_seeker.sh;fp=scripts%2Fshow_db%2Fmovie_seeker.sh;h=eccd0e580303a4affaaf70d81dba454c00eae6dd;hb=7b39f7e279005c8466ef508220a532ce2aa4abf8;hp=0000000000000000000000000000000000000000;hpb=3fbd372b35b15a19fb171d5ae34294ff7b1e6485;p=feisty_meow.git diff --git a/scripts/show_db/movie_seeker.sh b/scripts/show_db/movie_seeker.sh new file mode 100644 index 00000000..eccd0e58 --- /dev/null +++ b/scripts/show_db/movie_seeker.sh @@ -0,0 +1,14 @@ +#!/bin/bash +if [ -z "$1" -o -z "$2" ]; then + echo You must supply a file name that has a movie database in it and a movie + echo or show name to search for. Example: + echo 'movie_seeker "$HOME/moviedb.txt" "star trek"' + exit 2 +fi +SEEKING="$2" +if [ -z "$SEEKING" ]; then + SEEKING='.\\*' +fi +#echo "pattern is $SEEKING" +cat "$1" | grep -v '","[^"]*","[^"]' | sed -e 's/^\"\([a-zA-Z0-9][a-zA-Z0-9 ]*\)\",\"\([^\"][^\"]*\)\".*$/\2 [\1]/' | grep -i "$SEEKING" | sort | uniq +