Skip to main content  
        iSeries_home   |   EASY400     |   CGIDEV2     |   MMAIL  
Public-Source
 
Introduction
Command set 1
Command set 2
 Appendix A
Appendix B
 Download
 
 

 
Appendix A
Work with Qshell "zip" command

Though you do not need to know nor to practice it, you may still be interested about how Qshell command "zip" works in its native mode.

  1. Command STRQSH (start QSH) has a CMD parameter. It allows to run a Qshell command.
    If you enter command STRQSH from the Command Entry screen without spacifying anything for the CMD parameter, you get to the Qshell Command Entry screen.
  2. Enter command zip without anything else. You will receive the help of this command, showing all its options:

You may then try the following sample commands. After installing this utility you may work with stream files a.txt and b.txt in IFS directory /zip/test.

  1. Command ZIP
    • zip /tmp/x.zip /zip/test/a.txt /zip/test/b.txt
      This command compresses files /zip/test/a.txt and /zip/test/b.txt into file /tmp/x.zip.
      The compressed files maintain their directory paths. Directory paths are recreated when these files are inflated.
    • zip -j /tmp/x.zip /zip/test/a.txt /zip/test/b.txt
      This command is similar to the previous one. However, in this case the compressed files do not maintain their directory paths and directory paths are not recreated when these files are inflated.
    • zip -r /tmp/x.zip /zip/test
      This command compresses all the files in directory /test into file /zip/x.zip.
      The compressed files maintain their directory paths.
    • zip -jr /tmp/x.zip /zip/test
      This command compresses all the files in directory /test into file /zip/x.zip.
      The compressed files do not maintain their directory paths.
  2. Command UNZIP
    • unzip /tmp/x.zip
      this command extracts files /test/a.txt and /test/b.txt,
      but would prompt if a file already exists.
      Notes:
      1. The target directory for the extracted files is the current directory, usually /home/user_profile_name
      2. One may change the current directory (BEFORE STRQSH) with command chgcurdir.
      3. The original file directories are maintained.
    • unzip -o /tmp/x.zip
      this command extracts files /test/a.txt and /test/b.txt
      Note:
      1. Modifier -o allows to overwrite existing files without prompting for an user decision
    • unzip -n /tmp/x.zip
      this command extracts files /test/a.txt and /test/b.txt
      Note:
      1. Modifier -n does not overwrite existing files and does not prompt for an user decision
    • unzip -j /tmp/x.zip
      this command extracts files a.txt and b.txt
      Note:
      1. Modifier -j ignores the directories of the original files
    • unzip /tmp/x.zip -d /tmp
      this command extracts files /zip/tmp/test/a.txt and /zip/tmp/test/b.txt.
      Note:
      1. Option -d target_directory allows to specify a target directory
    • unzip -P bigblock /zip/test/crypted.zip -d /tmp
      this command unzips crypted file /zip/test/crypted.zip by providing the password "bigblock".

    • My favorite UNZIP format:
      unzip -oj /tmp/x.zip -d /mydirectory