Commit d56b4206 authored by Kathryn Elliott's avatar Kathryn Elliott

Script for basic keyword search of text corpus

parent 65628391
#!/bin/bash
word_file=$1
corpus_dir=$2
if [[ -z $word_file ]] || [[ -z $corpus_dir ]]; then
echo "usage: $0 <word file> <corpus directory>"
exit
fi
for word in $(grep -Ev "^[#|$]" $word_file); do
# grep --recursive -Fi $word $corpus_dir
count=$(grep --recursive -Fi $word $corpus_dir | wc -l)
echo "$word -> $count"
done
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment