Merge branch 'master' of feistymeow.org:feisty_meow
[feisty_meow.git] / scripts / show_db / movie_seeker.sh
diff --git a/scripts/show_db/movie_seeker.sh b/scripts/show_db/movie_seeker.sh
new file mode 100644 (file)
index 0000000..eccd0e5
--- /dev/null
@@ -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 
+