{
    "content": [
        {
            "type": "text",
            "text": "# unzipsfx(1) (man)\n\n**Summary:** unzipsfx - self-extracting stub for prepending to ZIP archives\n\n**Synopsis:** <name of unzipsfx+archive combo> [-cfptuz[ajnoqsCLV$]] [file(s) ... [-x xfile(s) ...]]\n\n## Examples\n\n- `To create a self-extracting archive letters from a regular zipfile letters.zip and change the`\n- `new archive's permissions to be world-executable under Unix:`\n- `cat unzipsfx letters.zip > letters`\n- `chmod 755 letters`\n- `zip -A letters`\n- `To create the same archive under MS-DOS, OS/2 or NT (note the use of the /b  [binary]  option`\n- `to the copy command):`\n- `copy /b unzipsfx.exe+letters.zip letters.exe`\n- `zip -A letters.exe`\n- `Under VMS:`\n- `copy unzipsfx.exe,letters.zip letters.exe`\n- `letters == \"$currentdisk:[currentdir]letters.exe\"`\n- `zip -A letters.exe`\n- `(The  VMS  append command may also be used.  The second command installs the new program as a`\n- ```foreign command'' capable of taking arguments.  The third line assumes that Zip is  already`\n- `installed as a foreign command.)  Under AmigaDOS:`\n- `MakeSFX letters letters.zip UnZipSFX`\n- `(MakeSFX  is included with the UnZip source distribution and with Amiga binary distributions.`\n- ```zip -A'' doesn't work on Amiga self-extracting archives.)  To test (or list) the newly cre‐`\n- `ated self-extracting archive:`\n- `letters -t`\n- `To test letters quietly, printing only a summary message indicating whether the archive is OK`\n- `or not:`\n- `letters -tqq`\n- `To extract the complete contents into the current directory, recreating all files and  subdi‐`\n- `rectories as necessary:`\n- `letters`\n- `To extract all *.txt files (in Unix quote the `*'):`\n- `letters *.txt`\n- `To extract everything except the *.txt files:`\n- `letters -x *.txt`\n- `To extract only the README file to standard output (the screen):`\n- `letters -c README`\n- `To print only the zipfile comment:`\n- `letters -z`\n\n## See Also\n\n- funzip(1)\n- unzip(1)\n- zip(1)\n- zipcloak(1)\n- zipgrep(1)\n- zipinfo(1)\n- zipnote(1)\n- zipsplit(1)\n\n## Section Outline\n\n- **NAME** (2 lines)\n- **SYNOPSIS** (2 lines)\n- **DESCRIPTION** (25 lines)\n- **ARGUMENTS** (37 lines)\n- **OPTIONS** (9 lines)\n- **MODIFIERS** (14 lines)\n- **ENVIRONMENT OPTIONS** (4 lines)\n- **DECRYPTION** (5 lines)\n- **AUTORUN COMMAND** (17 lines)\n- **EXAMPLES** (57 lines)\n- **LIMITATIONS** (38 lines)\n- **DIAGNOSTICS** (3 lines)\n- **SEE ALSO** (2 lines)\n- **URL** (5 lines)\n- **AUTHORS** (7 lines)\n\n## Full Content\n\n### NAME\n\nunzipsfx - self-extracting stub for prepending to ZIP archives\n\n### SYNOPSIS\n\n<name of unzipsfx+archive combo> [-cfptuz[ajnoqsCLV$]] [file(s) ... [-x xfile(s) ...]]\n\n### DESCRIPTION\n\nunzipsfx  is a modified version of unzip(1) designed to be prepended to existing ZIP archives\nin order to form self-extracting archives.  Instead of taking its first non-flag argument  to\nbe  the  zipfile(s) to be extracted, unzipsfx seeks itself under the name by which it was in‐\nvoked and tests or extracts the contents of the appended  archive.   Because  the  executable\nstub  adds  bulk to the archive (the whole purpose of which is to be as small as possible), a\nnumber of the less-vital capabilities in regular unzip have been removed.   Among  these  are\nthe  usage (or help) screen, the listing and diagnostic functions (-l and -v), the ability to\ndecompress older compression formats (the ``reduce,'' ``shrink''  and  ``implode''  methods).\nThe  ability  to  extract to a directory other than the current one can be selected as a com‐\npile-time option, which is now enabled by default since UnZipSFX version 5.5.  Similarly, de‐\ncryption  is supported as a compile-time option but should be avoided unless the attached ar‐\nchive contains encrypted files. Starting with release 5.5, another compile-time option adds a\nsimple ``run command after extraction'' feature.  This feature is currently incompatible with\nthe ``extract to different directory'' feature and remains disabled by default.\n\nNote that self-extracting archives made with unzipsfx are no more (or less)  portable  across\ndifferent  operating systems than is the unzip executable itself.  In general a self-extract‐\ning archive made on a particular Unix system, for example, will only self-extract  under  the\nsame flavor of Unix.  Regular unzip may still be used to extract the embedded archive as with\nany normal zipfile, although it will generate a harmless warning about extra bytes at the be‐\nginning  of  the  zipfile.  Despite this, however, the self-extracting archive is technically\nnot a valid ZIP archive, and PKUNZIP may be unable to test or extract it.  This limitation is\ndue  to  the simplistic manner in which the archive is created; the internal directory struc‐\nture is not updated to reflect the extra bytes prepended to the original zipfile.\n\n### ARGUMENTS\n\n[file(s)]\nAn optional list of archive members to be processed.  Regular expressions  (wildcards)\nsimilar  to those in Unix egrep(1) may be used to match multiple members.  These wild‐\ncards may contain:\n\n*      matches a sequence of 0 or more characters\n\n?      matches exactly 1 character\n\n[...]  matches any single character found inside the brackets; ranges are specified by\na  beginning  character,  a hyphen, and an ending character.  If an exclamation\npoint or a caret (`!' or `^') follows the left bracket, then the range of char‐\nacters  within the brackets is complemented (that is, anything except the char‐\nacters inside the brackets is considered a match).\n\n(Be sure to quote any character that might otherwise be interpreted or modified by the\noperating system, particularly under Unix and VMS.)\n\n[-x xfile(s)]\nAn  optional  list  of archive members to be excluded from processing.  Since wildcard\ncharacters match directory separators (`/'), this option may be used  to  exclude  any\nfiles that are in subdirectories.  For example, ``foosfx *.[ch] -x */*'' would extract\nall C source files in the main directory, but none in any subdirectories.  Without the\n-x  option,  all  C  source  files  in all directories within the zipfile would be ex‐\ntracted.\n\nIf unzipsfx is compiled with SFXEXDIR defined, the following option is also enabled:\n\n[-d exdir]\nAn optional directory to which to extract files.  By default, all files and  subdirec‐\ntories  are  recreated in the current directory; the -d option allows extraction in an\narbitrary directory (always assuming one has permission to write  to  the  directory).\nThe option and directory may be concatenated without any white space between them, but\nnote that this may cause normal shell  behavior  to  be  suppressed.   In  particular,\n``-d ~''  (tilde) is expanded by Unix C shells into the name of the user's home direc‐\ntory, but ``-d~'' is treated as a literal subdirectory ``~'' of the current directory.\n\n### OPTIONS\n\nunzipsfx supports the following unzip(1) options:   -c  and  -p  (extract  to  standard  out‐\nput/screen), -f and -u (freshen and update existing files upon extraction), -t (test archive)\nand -z (print archive comment).  All normal listing options (-l, -v and  -Z)  have  been  re‐\nmoved,  but  the testing option (-t) may be used as a ``poor man's'' listing.  Alternatively,\nthose creating self-extracting archives may wish to include a short listing  in  the  zipfile\ncomment.\n\nSee unzip(1) for a more complete description of these options.\n\n### MODIFIERS\n\nunzipsfx currently supports all unzip(1) modifiers:  -a (convert text files), -n (never over‐\nwrite), -o (overwrite without prompting), -q (operate quietly), -C (match names case-insensi‐\ntively), -L (convert uppercase-OS names to lowercase), -j (junk paths) and -V (retain version\nnumbers); plus the following operating-system specific options:  -X (restore  VMS  owner/pro‐\ntection  info),  -s  (convert spaces in filenames to underscores [DOS, OS/2, NT]) and -$ (re‐\nstore volume label [DOS, OS/2, NT, Amiga]).\n\n(Support for regular ASCII text-conversion may be removed in future  versions,  since  it  is\nsimple enough for the archive's creator to ensure that text files have the appropriate format\nfor the local OS.  EBCDIC conversion will of course continue to be supported since  the  zip‐\nfile format implies ASCII storage of text files.)\n\nSee unzip(1) for a more complete description of these modifiers.\n\n### ENVIRONMENT OPTIONS\n\nunzipsfx  uses the same environment variables as unzip(1) does, although this is likely to be\nan issue only for the person creating and testing the self-extracting archive.  See  unzip(1)\nfor details.\n\n### DECRYPTION\n\nDecryption  is  supported  exactly  as in unzip(1); that is, interactively with a non-echoing\nprompt for the password(s).  See unzip(1) for details.  Once again, note that if the  archive\nhas  no  encrypted files there is no reason to use a version of unzipsfx with decryption sup‐\nport; that only adds to the size of the archive.\n\n### AUTORUN COMMAND\n\nWhen unzipsfx was compiled with CHEAPSFXAUTORUN defined, a simple ``command autorun''  fea‐\nture  is supported. You may enter a command into the Zip archive comment, using the following\nformat:\n\n$AUTORUN$>[command line string]\n\nWhen unzipsfx recognizes the ``$AUTORUN$>'' token at the beginning of the  Zip  archive  com‐\nment,  the  remainder of the first line of the comment (until the first newline character) is\npassed as a shell command to the operating system using the C rtl ``system'' function. Before\nexecuting  the command, unzipsfx displays the command on the console and prompts the user for\nconfirmation.  When the user has switched off prompting by specifying the -q option,  autorun\ncommands are never executed.\n\nIn  case  the archive comment contains additional lines of text, the remainder of the archive\ncomment following the first line is displayed normally, unless quiet operation was  requested\nby supplying a -q option.\n\n### EXAMPLES\n\nTo create a self-extracting archive letters from a regular zipfile letters.zip and change the\nnew archive's permissions to be world-executable under Unix:\n\ncat unzipsfx letters.zip > letters\nchmod 755 letters\nzip -A letters\n\nTo create the same archive under MS-DOS, OS/2 or NT (note the use of the /b  [binary]  option\nto the copy command):\n\ncopy /b unzipsfx.exe+letters.zip letters.exe\nzip -A letters.exe\n\nUnder VMS:\n\ncopy unzipsfx.exe,letters.zip letters.exe\nletters == \"$currentdisk:[currentdir]letters.exe\"\nzip -A letters.exe\n\n(The  VMS  append command may also be used.  The second command installs the new program as a\n``foreign command'' capable of taking arguments.  The third line assumes that Zip is  already\ninstalled as a foreign command.)  Under AmigaDOS:\n\nMakeSFX letters letters.zip UnZipSFX\n\n(MakeSFX  is included with the UnZip source distribution and with Amiga binary distributions.\n``zip -A'' doesn't work on Amiga self-extracting archives.)  To test (or list) the newly cre‐\nated self-extracting archive:\n\nletters -t\n\nTo test letters quietly, printing only a summary message indicating whether the archive is OK\nor not:\n\nletters -tqq\n\nTo extract the complete contents into the current directory, recreating all files and  subdi‐\nrectories as necessary:\n\nletters\n\nTo extract all *.txt files (in Unix quote the `*'):\n\nletters *.txt\n\nTo extract everything except the *.txt files:\n\nletters -x *.txt\n\nTo extract only the README file to standard output (the screen):\n\nletters -c README\n\nTo print only the zipfile comment:\n\nletters -z\n\n### LIMITATIONS\n\nThe principle and fundamental limitation of unzipsfx is that it is not portable across archi‐\ntectures or operating systems, and therefore neither are the resulting  archives.   For  some\narchitectures  there  is  limited  portability, however (e.g., between some flavors of Intel-\nbased Unix).\n\nAnother problem with the current implementation is that any archive with  ``junk''  prepended\nto the beginning technically is no longer a zipfile (unless zip(1) is used to adjust the zip‐\nfile offsets appropriately, as noted above).  unzip(1) takes note of the prepended bytes  and\nignores them since some file-transfer protocols, notably MacBinary, are also known to prepend\njunk.  But PKWARE's archiver suite may not be able to deal with the modified  archive  unless\nits offsets have been adjusted.\n\nunzipsfx  has no knowledge of the user's PATH, so in general an archive must either be in the\ncurrent directory when it is invoked, or else a full or relative path must be  given.   If  a\nuser attempts to extract the archive from a directory in the PATH other than the current one,\nunzipsfx will print a warning to the effect, ``can't find myself.''  This is always true  un‐\nder  Unix  and may be true in some cases under MS-DOS, depending on the compiler used (Micro‐\nsoft C fully qualifies the program name, but other compilers may not).   Under  OS/2  and  NT\nthere  are  operating-system  calls available that provide the full path name, so the archive\nmay be invoked from anywhere in the user's path.  The situation is not  known  for  AmigaDOS,\nAtari TOS, MacOS, etc.\n\nAs  noted above, a number of the normal unzip(1) functions have been removed in order to make\nunzipsfx smaller:  usage and diagnostic info, listing functions and extraction to  other  di‐\nrectories.   Also,  only  stored  and deflated files are supported.  The latter limitation is\nmainly relevant to those who create SFX archives, however.\n\nVMS users must know how to set up self-extracting archives as foreign commands  in  order  to\nuse  any of unzipsfx's options.  This is not necessary for simple extraction, but the command\nto do so then becomes, e.g., ``run letters'' (to continue the examples given above).\n\nunzipsfx on the Amiga requires the use of a special program,  MakeSFX,  in  order  to  create\nworking  self-extracting archives; simple concatenation does not work.  (For technically ori‐\nented users, the attached archive is defined as a ``debug hunk.'')  There may be  compatibil‐\nity problems between the ROM levels of older Amigas and newer ones.\n\nAll current bugs in unzip(1) exist in unzipsfx as well.\n\n### DIAGNOSTICS\n\nunzipsfx's  exit status (error level) is identical to that of unzip(1); see the corresponding\nman page.\n\n### SEE ALSO\n\nfunzip(1), unzip(1), zip(1), zipcloak(1), zipgrep(1), zipinfo(1), zipnote(1), zipsplit(1)\n\n### URL\n\nThe Info-ZIP home page is currently at\nhttp://www.info-zip.org/pub/infozip/\nor\nftp://ftp.info-zip.org/pub/infozip/ .\n\n### AUTHORS\n\nGreg Roelofs was responsible for the basic modifications to UnZip  necessary  to  create  Un‐\nZipSFX.   See  unzip(1) for the current list of Zip-Bugs authors, or the file CONTRIBS in the\nUnZip source distribution for the full list of Info-ZIP contributors.\n\n\n\nInfo-ZIP                                20 April 2009 (v6.0)                             UNZIPSFX(1)\n\n"
        }
    ],
    "structuredContent": {
        "command": "unzipsfx",
        "section": "1",
        "mode": "man",
        "summary": "unzipsfx - self-extracting stub for prepending to ZIP archives",
        "synopsis": "<name of unzipsfx+archive combo> [-cfptuz[ajnoqsCLV$]] [file(s) ... [-x xfile(s) ...]]",
        "flags": [],
        "examples": [
            "To create a self-extracting archive letters from a regular zipfile letters.zip and change the",
            "new archive's permissions to be world-executable under Unix:",
            "cat unzipsfx letters.zip > letters",
            "chmod 755 letters",
            "zip -A letters",
            "To create the same archive under MS-DOS, OS/2 or NT (note the use of the /b  [binary]  option",
            "to the copy command):",
            "copy /b unzipsfx.exe+letters.zip letters.exe",
            "zip -A letters.exe",
            "Under VMS:",
            "copy unzipsfx.exe,letters.zip letters.exe",
            "letters == \"$currentdisk:[currentdir]letters.exe\"",
            "zip -A letters.exe",
            "(The  VMS  append command may also be used.  The second command installs the new program as a",
            "``foreign command'' capable of taking arguments.  The third line assumes that Zip is  already",
            "installed as a foreign command.)  Under AmigaDOS:",
            "MakeSFX letters letters.zip UnZipSFX",
            "(MakeSFX  is included with the UnZip source distribution and with Amiga binary distributions.",
            "``zip -A'' doesn't work on Amiga self-extracting archives.)  To test (or list) the newly cre‐",
            "ated self-extracting archive:",
            "letters -t",
            "To test letters quietly, printing only a summary message indicating whether the archive is OK",
            "or not:",
            "letters -tqq",
            "To extract the complete contents into the current directory, recreating all files and  subdi‐",
            "rectories as necessary:",
            "letters",
            "To extract all *.txt files (in Unix quote the `*'):",
            "letters *.txt",
            "To extract everything except the *.txt files:",
            "letters -x *.txt",
            "To extract only the README file to standard output (the screen):",
            "letters -c README",
            "To print only the zipfile comment:",
            "letters -z"
        ],
        "see_also": [
            {
                "name": "funzip",
                "section": "1",
                "url": "https://www.chedong.com/phpMan.php/man/funzip/1/json"
            },
            {
                "name": "unzip",
                "section": "1",
                "url": "https://www.chedong.com/phpMan.php/man/unzip/1/json"
            },
            {
                "name": "zip",
                "section": "1",
                "url": "https://www.chedong.com/phpMan.php/man/zip/1/json"
            },
            {
                "name": "zipcloak",
                "section": "1",
                "url": "https://www.chedong.com/phpMan.php/man/zipcloak/1/json"
            },
            {
                "name": "zipgrep",
                "section": "1",
                "url": "https://www.chedong.com/phpMan.php/man/zipgrep/1/json"
            },
            {
                "name": "zipinfo",
                "section": "1",
                "url": "https://www.chedong.com/phpMan.php/man/zipinfo/1/json"
            },
            {
                "name": "zipnote",
                "section": "1",
                "url": "https://www.chedong.com/phpMan.php/man/zipnote/1/json"
            },
            {
                "name": "zipsplit",
                "section": "1",
                "url": "https://www.chedong.com/phpMan.php/man/zipsplit/1/json"
            }
        ],
        "section_outline": [
            {
                "name": "NAME",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "SYNOPSIS",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "DESCRIPTION",
                "lines": 25,
                "subsections": []
            },
            {
                "name": "ARGUMENTS",
                "lines": 37,
                "subsections": []
            },
            {
                "name": "OPTIONS",
                "lines": 9,
                "subsections": []
            },
            {
                "name": "MODIFIERS",
                "lines": 14,
                "subsections": []
            },
            {
                "name": "ENVIRONMENT OPTIONS",
                "lines": 4,
                "subsections": []
            },
            {
                "name": "DECRYPTION",
                "lines": 5,
                "subsections": []
            },
            {
                "name": "AUTORUN COMMAND",
                "lines": 17,
                "subsections": []
            },
            {
                "name": "EXAMPLES",
                "lines": 57,
                "subsections": []
            },
            {
                "name": "LIMITATIONS",
                "lines": 38,
                "subsections": []
            },
            {
                "name": "DIAGNOSTICS",
                "lines": 3,
                "subsections": []
            },
            {
                "name": "SEE ALSO",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "URL",
                "lines": 5,
                "subsections": []
            },
            {
                "name": "AUTHORS",
                "lines": 7,
                "subsections": []
            }
        ]
    }
}