04-08-2008
unzip .zip file and list the files included in the .zip archive
Hello,
I am trying to return the name of the resulting file from a .zip archive file using unix unzip command.
unzip c07212007.cef7081.zip
Archive: c07212007.cef7081.zip
SecureZIP for z/OS by PKWARE
inflating: CEP/CEM7080/PPVBILL/PASS/G0063V00
I used the following command to unzip in quite mode (-q), without making directories(-j) and overwrite existing files(-o)
unzip - qjo c07212007.cef7081.zip
The above cmd unzippes the file "G0063V00" in the current working directory.
In addition to unzipping the file in the current working dir, I would like to store the filename resulting filename "G0063V00" in a variable for further processing. How do I get the filename that was just unzipped ? I tried using -l option but I get a lot more information than needed.
unzip -qjol c07212007.cef7081.zip
Length Date Time Name
-------- ---- ---- ----
265 07-22-07 03:32 CEP/CEM7080/PPVBILL/PASS/G0063V00
-------- -------
265 1 file
So I tried the following:
basename "`unzip -qojl c07212007.cef7081.zip`"
G0063V00
-------- -------
265 1 file
As you see, I still get more information than I need. I just want to return the filename which in this case is "G0063V00".
Thanks for you help in advance.
10 More Discussions You Might Find Interesting
1. HP-UX
Hi All
I have ftped a .ZIP file (zipped using WinZip in Windows) to my Unix server (HP-UX).
I don't have unzip cmd available in my curent Unix version
Please let me know any cmd in UNIX (other than unzip) using which I can unzip this .ZIP file .
Please elaborate on the commands aval and... (5 Replies)
Discussion started by: sureshg_sampat
5 Replies
2. Shell Programming and Scripting
Hi All
I have ftped a .ZIP file (zipped using WinZip in Windows) to my Unix server (HP-UX).
I don't have unzip cmd available in my curent Unix version
Please let me know any cmd in UNIX (other than unzip) using which I can unzip this .ZIP file .
Please elaborate on the commands aval and... (5 Replies)
Discussion started by: sureshg_sampat
5 Replies
3. Shell Programming and Scripting
Hi,
I need to zip/compress a data file and send to a vendor. The vendor does have only unzip utility and can accept only .ZIP files. I do not have zip utility in my server.
How do I zip/compress the file so that it can be deflated using unzip command ? I tried gzip & compress commands, but... (1 Reply)
Discussion started by: Sabari Nath S
1 Replies
4. AIX
I have to zip many pdf files and the size of zip file must not exceed 200 MB. When size is more than 200 MB then multiple zip files needs to be created.
How we can achieve this in UNIX?
I have tried ZIP utility but it takes a lot of time when we add individual pdfs by looping through a... (1 Reply)
Discussion started by: tom007
1 Replies
5. Shell Programming and Scripting
Hi all,
i've got the following problem:
We've got a shell-script, that creates some different files based on several criteria given, using a sql-script.
After creating, those files are individually zipped and stored, then sent to a ftp-server.
This is all working since 2010, but now they have... (3 Replies)
Discussion started by: Biggreuda
3 Replies
6. Shell Programming and Scripting
Hi
I have a requirement in unix shell where I need to zip multiple files on server to one single .zip file. I dont see zip command in AIX and gzip command not doing completely what I want.
One I do .zip file, I should be able to unzip in my local Computer.
Here is example what I want... (9 Replies)
Discussion started by: RAMA PULI
9 Replies
7. Shell Programming and Scripting
I have .zip file, i want to list all the files archived in the zip file. unzip utility is not working for me in unix.
Please help me resolve this issue
Thanks
ganesh. (3 Replies)
Discussion started by: Ganesh L
3 Replies
8. Shell Programming and Scripting
I receive multiple zipped directories with files in them, so the .zip name is the name of the directory containing the files.
so i have used a simple loop to unzip all of them but when unzipped i have folders/directories, i wanted to strip these directories and remain with the actual files from... (1 Reply)
Discussion started by: buggzdiq
1 Replies
9. UNIX for Beginners Questions & Answers
Hi all i am very new to shell scripting and need some help from you to learn
1)i have some log files that gets generated on daily basis example: i have abc_2017_01_30_1.log ,2017_01_30_2.log like wise so i want to zip this 4 logs which are created on same date into one zip folder.
2)Post zipping... (2 Replies)
Discussion started by: b.saipriyanka
2 Replies
10. Shell Programming and Scripting
Hi all i am very new to shell scripting and need some help from you to learn
1)i have some log files that gets generated on daily basis example: i have abc_2017_01_30_1.log ,2017_01_30_2.log like wise so i want to zip this 4 logs which are created on same date into one zip folder.
2)Post zipping... (1 Reply)
Discussion started by: b.saipriyanka
1 Replies
LEARN ABOUT DEBIAN
zip2st
ZIP2ST(1) Hatari utilities ZIP2ST(1)
NAME
zip2st - a program for converting .zip archives to Atari .st disk images
SYNOPSIS
zip2st srcname.zip [dstname.st]
DESCRIPTION
zip2st can be used to convert a .zip file to a .st disk image.
If the destination filename is not given, use the name of the .zip file, without the extension, and save it in the current working direc-
tory.
Any single directories (other than 'auto') at root of the zip archive are traversed down to avoid adding redundant intermediate directories
from the zip file to the generated disk image.
The .st disk image is a raw disk image, and can be written to a floppy using dd(1) or converted to .msa disk image with hmsa(1).
The contents of the uncompressed zip file need to be smaller than 2.88MB (the largest floppy image size supported by Hatari).
SEE ALSO
hmsa(1), atari-hd-image(1), hatari(1), unzip(1), mtools(1), dd(1).
AUTHOR
Written by Thomas Huth <huth at tuxfamily.org>.
This manual page was written by Teemu Hukkanen <tjhukkan at iki.fi> for the Debian project and later modified by Eero Tamminen to suit the
latest version of Hatari.
LICENSE
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
NO WARRANTY
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MER-
CHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
Hatari 2012-05-30 ZIP2ST(1)