How to zip file in AIX with password.

Hi Guru,

I have assignment to create script to compress file as .ZIP with password.
I don't know the command line in AIX. It's very new for me.
I'm try to use zip or tar but I don't have any option for encrypt with password.
Please kindly suggest me.
Thank you very much.

Multidev

what happens when you try

zip -e zipped.zip file1 file2
1 Like

Hi Skrynesaver,

Thank you for your quick reply.
No result to show on the screen.
and no a new file (zipped.zip)
I think my AIX does not has zip command.
I use "man zip" no any document but I use "man tar", system show tar help.
Please kindly suggest.
Thank you very much.

---------- Post updated at 08:56 AM ---------- Previous update was at 08:43 AM ----------

I've typed "oslevel" => System shown "5.3.0.0"

I was going to suggest

wget http://sourceforge.net/projects/infozip/files/unreleased%20Betas/UnZip%20betas/unzip610b.zip/download
unzip unzip610b.zip
cd unzip610b
cp unix/Makefile ./
. unix/configure
make aix
make install

and repeat the test, however there is an obvious problem with this, how do you unzip without zip available.

what does

man -k zip

suggest you have in the way of tools?

1 Like

Hi. Skrynesaver,

Thank you very much again.

I've typed as your suggestion.

wget http://sourceforge.net/projects/infozip/files/unreleased%20Betas/UnZip%20betas/unzip610b.zip/download

My AIX can not run wget. So I have to manual download file.

cp unix/Makefile ./


=============


. unix/configure
Check C compiler operation
  Ok
Check C compiler type (optimization options)
  Other-unknown C (-O)
Check for the C preprocessor
Check if we can use asm code
Check for ANSI options
Check for prototypes
Check the handling of const
Check for time_t
Check for size_t
Check for off_t
Check for Large File Support
  off_t is 8 bytes
   yes we have Large File Support!
Check for wide char support
   no Unicode support - wchar_t encoding unspecified
Check for setlocale support (needed for UNICODE Native check)
   have setlocale, can check for charset type
    - enabling UTF8-native support!
Check for gcc no-builtin flag
Check for fchmod
Check for lchown
Check for nl_langinfo
Check for lchmod
Check for memset
Check for errno declaration
Check for strerror
Check for directory libraries
Check for readlink
Check for directory include file
Check for non existent include files
Check for term I/O include file
Check for MBCS include files
Check for MBCS support
   have MBCS support
Check for MBCS mbschr
Check for MBCS mbsrchr
Check for valloc
Check for /usr/local/bin and /usr/local/man
Checking for OS specialties
Check for symbolic links
Check bzip2 support
  Check for bzip2 sources in unzip's bzip2 subdirectory
   bzip2 sources not found - no bzip2 support

======================

make aix
ln: 0653-421 ./Makefile exists.
    Specify -f to remove ./Makefile before linking.
#make unzips CF="-O -I. -DUNIX    -DBSD -D_BSD -DUNIX" LF2="-lbsd"
#cc -c -O -I. -DUNIX    -DBSD -D_BSD -DUNIX unzip.c
#cc -c -O -I. -DUNIX    -DBSD -D_BSD -DUNIX crc32.c
#cc -c -O -I. -DUNIX    -DBSD -D_BSD -DUNIX crypt.c
#cc -c -O -I. -DUNIX    -DBSD -D_BSD -DUNIX envargs.c
#cc -c -O -I. -DUNIX    -DBSD -D_BSD -DUNIX explode.c
#cc -c -O -I. -DUNIX    -DBSD -D_BSD -DUNIX extract.c
#cc -c -O -I. -DUNIX    -DBSD -D_BSD -DUNIX fileio.c
#cc -c -O -I. -DUNIX    -DBSD -D_BSD -DUNIX globals.c
#cc -c -O -I. -DUNIX    -DBSD -D_BSD -DUNIX inflate.c
#cc -c -O -I. -DUNIX    -DBSD -D_BSD -DUNIX list.c
#cc -c -O -I. -DUNIX    -DBSD -D_BSD -DUNIX match.c
#cc -c -O -I. -DUNIX    -DBSD -D_BSD -DUNIX process.c
#cc -c -O -I. -DUNIX    -DBSD -D_BSD -DUNIX ttyio.c
#cc -c -O -I. -DUNIX    -DBSD -D_BSD -DUNIX ubz2err.c
#cc -c -O -I. -DUNIX    -DBSD -D_BSD -DUNIX unreduce.c
#cc -c -O -I. -DUNIX    -DBSD -D_BSD -DUNIX unshrink.c
#cc -c -O -I. -DUNIX    -DBSD -D_BSD -DUNIX zipinfo.c
#cc -c -O -I. -DUNIX    -DBSD -D_BSD -DUNIX unix/unix.c
#cc -o unzip  unzip.o crc32.o  crypt.o envargs.o explode.o extract.o fileio.o globals.o inflate.o list.o match.o process.o ttyio.o ubz2err.o unreduce.o unshrink.o zip

==================

make install
#mkdir -p /usr/local/bin
#cp unzip funzip unzipsfx /usr/local/bin

---------- Post updated at 11:39 AM ---------- Previous update was at 11:37 AM ----------

man -k zip

For above statement, no any respond.

Please kindly suggest again. Thank you very much. :b::b::b:

---------- Post updated at 11:41 AM ---------- Previous update was at 11:39 AM ----------

How do you unzip without zip available

  • Actually, I would like to create zip file with password and then I will send ftp .zip file to other server.

It worked, and even told you where it put the executables: /usr/local/bin. That's not likely to be in your PATH, so try running it with the absolute path instead: /usr/local/bin/unzip

1 Like

Thank you all. Now my requirement has been done already.
I've used zip 3.0 from

http://www.info-zip.org/

and I can use zip with password protection as "zip -P password zipfile.zip filename.xxx"

if you have java use this.

jar cvf zipped.zip file1 file2