projects
/
cmccabe-bin
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
602c5b22bf5f481a3f8a7e4a05a87d964313f2f7
[cmccabe-bin]
/
head_grep.sh
1
#!/bin/bash
2
3
#
4
# Grep the first few lines of a file.
5
# Print out any matches if they are found, along with the file name.
6
#
7
# Colin McCabe
8
#
9
10
find -type f | while read F; do
11
if head -n 50 $F | grep -q ${@}; then
12
echo -n "${F}: "
13
grep ${@} $F
14
fi
15
done