The -i
and -x
parameters of the 7-zip CLI interpet !
in a special way. Or at least it looks that way from their documentation. That documentation includes the following:
Syntax
-i[<recurse_type>]<file_ref> <recurse_type> ::= r[- | 0] <file_ref> ::= @{listfile} | !{wildcard}
Parameters
<file_ref>
Specifies filenames and wildcards, or a list file, for files to be processed.
<file_ref> ::= @{listfile} | !{wildcard}
Examples
7z a -tzip src.zip *.txt -ir!DIR1\*.cpp
adds to src.zip archive all *.txt files from current directory and all *.cpp files from directory DIR1 and from all it's subdirectories.
I haven't, however, found an explicit statement about how !
is meant to be used. It seems from the reference to !{wildcard}
that !
might indicate that <file_ref>
contains wildcards. I'm skeptical about that, however, because such an indicator seems unnecessary.
How, exactly, is !
meant to be used with 7-zip CLI parameters?