exception granted for execute bit on movie scripts
[feisty_meow.git] / scripts / show_db / movie_seeker.sh
1 #!/bin/bash
2 if [ -z "$1" -o -z "$2" ]; then
3   echo You must supply a file name that has a movie database in it and a movie
4   echo or show name to search for.  Example:
5   echo 'movie_seeker "$HOME/moviedb.txt" "star trek"'
6   exit 2
7 fi
8 SEEKING="$2"
9 if [ -z "$SEEKING" ]; then
10   SEEKING='.\\*'
11 fi
12 #echo "pattern is $SEEKING"
13 cat "$1" | grep -v '","[^"]*","[^"]' |  sed -e 's/^\"\([a-zA-Z0-9][a-zA-Z0-9 ]*\)\",\"\([^\"][^\"]*\)\".*$/\2 [\1]/' | grep -i "$SEEKING" | sort | uniq 
14