Created
May 18, 2014 23:36
-
-
Save abstractOwl/eeafdcd0f39a50dc520c to your computer and use it in GitHub Desktop.
grep a directory of pdfs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
for f in ${2}/.pdf; do | |
out=$(pdftotext $f - | grep -n $1) | |
if [ $? -eq 0 ]; then | |
echo -e "${f}:\n${out}\n" | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment