Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- tar -ztf file.tar.gz | while read FILENAME
- do
- if tar -zxf file.tar.gz "$FILENAME" -O | grep "string" > /dev/null
- then
- echo "$FILENAME contains string"
- fi
- done
- zgrep -a string file.tar.gz
- $ tar xf file.tar.gz --to-command "awk '/bar/ { print ENVIRON["TAR_FILENAME"]; exit }'"
- bfe2/.bferc
- bfe2/CHANGELOG
- bfe2/README.bferc
- tar zxf file.tar.gz
- for f in hopefullySomeSubdir/*; do
- grep -l "string" $f
- done
- tar xzf example.tgz --to-command 'grep --label="$TAR_FILENAME" -H PATTERN ; true'
- targrep () {
- for i in $(tar -tzf "$1"); do
- results=$(tar -Oxzf "$1" "$i" | grep --label="$i" -H "$2")
- echo "$results"
- done
- }
- targrep example.tar.gz "pattern"
- tar -ztf file.tar.gz | while read FILENAME
- do
- (if tar -zxf file.tar.gz "$FILENAME" -O | grep -l "string"
- then
- echo "$FILENAME contains string"
- fi) &
- done
- local tempPath=`tempfile`
- mkdir $tempPath && tar -zxf file.tar.gz -C $tempPath &&
- find $tempPath -type f | while read FILENAME
- do
- (if grep -l "string" "$FILENAME"
- then
- echo "$FILENAME contains string"
- fi) &
- done && rm -r $tempPath
- -l, --files-with-matches
- Suppress normal output; instead print the name of each input file from which output would
- normally have been printed. The scanning will stop on the first match. (-l is specified
- by POSIX.)
- pattern=$1
- for f in *.tar.gz; do
- echo "$f:"
- tar -xzf "$f" --to-command 'grep --label="`basename $TAR_FILENAME`" -Hin '"$pattern ; true";
- done
- tar -xzf "$f" --to-command 'echo "f:`basename $TAR_FILENAME` s:'"$pattern""
- 'grep --label="`basename $TAR_FILENAME`" -Hin '"$pattern ; true"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement