#20 Can't extract any files with the brackets in the names
open
nobody
None
5
2007-11-19
2007-11-19
Anonymous
No
Say I have the file "test_for_unzip[1].txt". I can zip it, but not unzip by it's name, so "unzip tezt.zip test_for_unzip[1].txt" doesn't work:
caution: filename not matched: test_for_unzip[1].txt
Because zip/unzip use brackets as part of their wildcard symbols, you have to use [[] to represent a left bracket, e.g.
unzip test.zip test_for_unzip[[]1].txt
From "zip -h2" output (zip 3.0):
Wildcards:
Internally zip supports the following wildcards:
? (or % or #, depending on OS) matches any single character
* matches any number of characters, including zero
[list] matches char in list (regex), can do range [ac-f], all but [!bf]
If port supports [], must escape [ as [[] or use -nw to turn off wildcards
Normally * crosses dir bounds in path, e.g. 'a*b' can match 'ac/db'. If
-W option used, * does not cross dir bounds but ** does
For shells that expand wildcards, escape (\* or "*") so zip can recurse
zip zipfile -r . -i "*.h"
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Logged In: YES
user_id=681780
Originator: NO
Because zip/unzip use brackets as part of their wildcard symbols, you have to use [[] to represent a left bracket, e.g.
unzip test.zip test_for_unzip[[]1].txt
From "zip -h2" output (zip 3.0):
Wildcards:
Internally zip supports the following wildcards:
? (or % or #, depending on OS) matches any single character
* matches any number of characters, including zero
[list] matches char in list (regex), can do range [ac-f], all but [!bf]
If port supports [], must escape [ as [[] or use -nw to turn off wildcards
Normally * crosses dir bounds in path, e.g. 'a*b' can match 'ac/db'. If
-W option used, * does not cross dir bounds but ** does
For shells that expand wildcards, escape (\* or "*") so zip can recurse
zip zipfile -r . -i "*.h"