unzipsfx is a modified version of unzip designed to be prepended to existing ZIP archives in order to form self-extracting archives. Instead of taking its first non-flag argument to be the zipfile, unzipsfx seeks itself under the name by which it was invoked and tests or extracts the contents of the appended archive. Because the executable stub adds bulk to the archive, a number of the less-vital capabilities in regular unzip have been removed.
Note that self-extracting archives made with unzipsfx are not portable across different operating systems. Regular unzip may still be used to extract the embedded archive as with any normal zipfile, although it will generate a harmless warning about extra bytes at the beginning of the zipfile.
Syntax
|
An optional list of archive members to be processed. Regular expressions (wildcards) similar to those in egrep may be used to match multiple members.
An optional list of archive members to be excluded from processing.
An optional directory to which to extract files. By default, all files and subdirectories are recreated in the current directory; the -d option allows extraction in an arbitrary directory. Options unzipsfx supports the following unzip options: -c and -p (extract to standard output or pipe), -f and -u (freshen and update existing files upon extraction), -t (test archive) and -z (print archive comment). All normal listing options (-l, -v and -Z) have been removed, but the testing option (-t) may be used to list the entries. See unzip for a more complete description of these options. Modifiers unzipsfx currently supports all unzip modifiers: -a (convert text files), -n (never overwrite), -o (overwrite without prompting), -q (operate quietly), -C (match names case-insensitively), -L (convert names to lowercase) and -j (junk paths). See unzip for a more complete description of these modifiers. |
Variable
unzipsfx uses the same environment variables as unzip. See unzip for details. |
Decryption
Decryption is supported exactly as in unzip. See unzip for details. |
Example
To create a self-extracting archive letters from a regular zipfile letters.zip, change the new archive’s permissions to be executable and adjust the entry offsets. cat /usr/bin/unzipsfx letters.zip > letters chmod +x letters zip -A letters To test letters quietly, printing only a summary message indicating whether the archive is OK or not:
To extract the complete contents into the current directory, recreating all files and subdirectories as necessary:
To extract all *.txt files:
To extract everything except the *.txt files:
To print only the zipfile comment:
|
Restrictions
The principle and fundamental limitation of unzipsfx is that it is not portable across architectures or operating systems. Another problem with the current implementation is that any archive with "junk" prepended to the beginning, technically is no longer a zipfile (unless zip is used to adjust the zipfile offsets appropriately, as noted above). unzip takes note of the prepended bytes and ignores them. But other archiver suites may not be able to deal with the modified archive unless its offsets have been adjusted. As noted above, a number of the normal unzip functions have been removed in order to make unzipsfx smaller. |
Exit status
unzipsfx’s exit status (error level) is identical to that of unzip; see unzip. |
See also
funzip, unzip, zip, zipcloak, zipgrep, zipinfo, zipnote, zipsplit |