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:
                                   QSH Command Entry         
                                                                                       
         If zipfile and list are omitted, zip compresses stdin to stdout.              
         -f   freshen: only changed files  -u   update: only changed or new files      
         -d   delete entries in zipfile    -m   move into zipfile (delete files)       
         -r   recurse into directories     -j   junk (don't record) directory names    
         -0   store only                   -l   convert LF to CR LF (-ll CR LF to LF)  
         -1   compress faster              -9   compress better                        
         -q   quiet operation              -v   verbose operation/print version info   
         -c   add one-line comments        -z   add zipfile comment                    
         -   read names from stdin        -o   make zipfile as old as latest entry    
         -x   exclude the following names  -i   include only the following names       
         -F   fix zipfile (-FF try harder) -D   do not add directory entries           
         -A   adjust self-extracting exe   -J   junk zipfile prefix (unzipsfx)         
         -T   test zipfile integrity       -X   eXclude eXtra file attributes          
         -y   store symbolic links as the link instead of the referenced file          
         -R   PKZIP recursion (see manual)                                             
         -h   show this help               -n   don't compress these suffixes          
       $                                                                               
                                                                                       
     ===>                                                                              
                                                                                       
                                                                                       
    
     F3=Exit   F6=Print F9=Retrieve F12=Disconnect                                     
     F13=Clear F17=Top  F18=Bottom  F21=CL command entry

You may then try the following sample commands. Upon installation of this utility you may play 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