Skip to content

Instantly share code, notes, and snippets.

@abstractOwl
Created May 18, 2014 23:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save abstractOwl/eeafdcd0f39a50dc520c to your computer and use it in GitHub Desktop.
Save abstractOwl/eeafdcd0f39a50dc520c to your computer and use it in GitHub Desktop.
grep a directory of pdfs
#!/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