Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
i want to replace a file in .zip file in AIX5.3 machine;
say i have file script.ksh file and a build.zip file which contains older version of script.ksh. i dont want to zip the entire thing. i want to replace newer version of script.ksh to build.zip file. please let me know how to do that. its bit urgent.
thanks in advance
Arun S

Example:
/home/oracle/luke/tmp$ ll test.zip
-rw-r--r-- 1 oracle oinstall 2619 Jul 28 08:10 test.zip/home/oracle/luke/tmp$ unzip -l test.zip
Archive: test.zip
Length Date Time Name
-------- ---- ---- ----
48 07-27-06 12:03 1.sh
487 07-28-06 08:10 2.sh
255 07-27-06 13:55 3.sh
264 07-27-06 12:09 file
405 07-27-06 13:29 file1
90 07-27-06 12:18 file2
18 07-08-06 01:17 in
4139 06-27-06 11:18 rep
-------- -------
5706 8 files(Then, modifidy 2.sh file)
/home/oracle/luke/tmp$ echo 999 > 2.sh/home/oracle/luke/tmp$ cat 2.sh
999(replace the old 2.sh in test.zip with the new 2.sh)
/home/oracle/luke/tmp$ zip -u test.zip 2.sh
updating: 2.sh (stored 0%)/home/oracle/luke/tmp$ unzip -l test.zip
Archive: test.zip
Length Date Time Name
-------- ---- ---- ----
48 07-27-06 12:03 1.sh
4 07-28-06 08:14 2.sh <== the time changed
255 07-27-06 13:55 3.sh
264 07-27-06 12:09 file
405 07-27-06 13:29 file1
90 07-27-06 12:18 file2
18 07-08-06 01:17 in
4139 06-27-06 11:18 rep
-------- -------
5223 8 files/home/oracle/luke/tmp$ echo 888 > 2.sh
/home/oracle/luke/tmp$ cat 2.sh
888(extract 2.sh from test.zip)
/home/oracle/luke/tmp$ unzip test.zip 2.sh
Archive: test.zip
replace 2.sh? [y]es, [n]o, [A]ll, [N]one, [r]ename: y
extracting: 2.sh(2.sh in test.zip was extracted)
/home/oracle/luke/tmp$ cat 2.sh
999Luke Chi

![]() |
![]() |
![]() |

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.
| Ads by Google |