So I have a script that iterates over zip files, lists their content with unzip -l $filename, and looks for matches to pattern (.*)report.xml
, in this case yields test0\report.xml
But when it tries to unzip using unzip -j $filename
, I get caution: filename not matched: test0\report.xml
I stopped and tried manually on a file which lists:
7285 2018-05-04 13:34 test0\report.xml
Then doing
unzip -j 2747693b-7027-44d3-98f4-a01f1ed139cf.zip test0\report.xml
Gives me the error caution: filename not matched: test0report.xml
I tried calling with \\
to escape it, then same error but saying test0\report.xml
instead.
I tried everything like \, or /, or // so I dont think this is backwards slash escaping issue.
Please help.
unzip -j $filename
just an example? if it's a part of your script, make itunzip -j "$filename"
.