4 # Author : Chris Koeritz
5 # Rights : Copyright (C) 2012-$now by Feisty Meow Concerns, Ltd.
7 # This script is free software; you can modify/redistribute it under the terms
8 # of the GNU General Public License. [ http://www.gnu.org/licenses/gpl.html ]
9 # Feel free to send updates to: [ fred@gruntose.com ]
12 # scours through the archive files (tar, zip, etc) in a directory looking for a pattern
13 # in the file. any matches are reported.
18 if [ -z "$dir" -o -z "$pattern" ]; then
19 echo This utility requires a pattern string that will be sought within a
20 echo directory, and the directory to scan. Any matches are reported.
24 TMPFILE="$(mktemp "$TMP/jarfinding.XXXXXX")"
26 #hmmm: below would be nicer if we had a util that told us all the types of archives
27 # that we support. then we could just skim across those types.
29 # locate all the archive files under the path.
30 find "$dir" -iname "*.jar" -o -iname "*.zip" -o -iname "*.tar" \
31 -o -iname "*.iar" -o -iname "*.oar" \
35 bash $FEISTY_MEOW_SCRIPTS/archival/listarch.sh "$line" 2>&1 | grep -i "$pattern" >/dev/null
36 if [ $? -eq 0 ]; then echo ==== Found pattern in $line ====; fi