root/scripts/notin.sh

Revision 135 (checked in by muness, 3 years ago)

--

Line 
1 #!/bin/sh
2 #1) Create a file of words you want to filter out.  Save it as "stoplist"
3 #2) cat <file> | ./notin.sh > file without any lines that include entries in stoplist
4
5 for dont in `cat stoplist`
6 do
7       strings=$dont\|$strings
8 done
9
10 if [ -n "$strings" ]; then
11       strings=`echo $strings|sed s/\|$//`
12       expr=" -v $strings -E"
13       grep $expr
14 else
15       cat
16 fi
Note: See TracBrowser for help on using the browser.