I have to find some text inside zipped files. I am using Cygwin. Some zipped files are empty. Obviously I don't want to have 'noisy' information about those 'empty zip files' at all. E.g.
find . -iname '*.zip' -print -exec unzip -l {} \; |grep -i vbs
Where vbs
is a string I'm searching for.
The problem is that it returns what I'm looking for but it also returns a lot of noise with lines like this:
C\ProgramData\ABC\DEF\VBScripts\OutputArchiveFiles.vbs
warning [/z/XYZ/Backup/123/456/Backup Set 1/Backup Files 1/Backup files 2.zip]: zipfile is empty
I don't want to see those lines with 'zipfile is empty'
I tried to pipe it with |grep -v 'zipfile is empty'
but it still outputs those lines as well.
My question: how can I avoid printing those 'empty' lines and see only the lines I'm looking for; i.e., vbs?