Mr_Noodle wrote:No way to do that unless you use some special script. The only option otherwise would be to unpack the archive then match on the file.
I'm wanting to do the same thing. I believe I'm pretty close, but maybe you can help me.
I am saving an "export.zip" to my downloads folder that I want to look inside (not extract) and then move the zip file elsewhere. The zip file is an Apple Health export file. So inside the zip there is one folder that is "apple_health_export" and inside that there is a file "export.xml". I'm using the unzip command to see if that file exists and then outputting that file to screen.
- Code: Select all
unzip -p $1 apple_health_export/export.xml | less
I'm using the Pass shell script condition, however no matter what the zip file is (The actual Health zip or some other zip named export.zip), it always matches the rule. So it's always exiting with status 0, but not sure why if the file I'm searching for doesn't exist. I'm sure I'm missing something here.