Go4Expert

Go4Expert (http://www.go4expert.com/)
-   Unix (http://www.go4expert.com/forums/unix-forum/)
-   -   How to unzip files from folder in shell script (ksh) (http://www.go4expert.com/forums/unzip-files-folder-shell-script-ksh-t23455/)

Poonamol 1Oct2010 15:07

How to unzip files from folder in shell script (ksh)
 
Hi,

I have a folder (C:\shellprg\input\) containing .CSV, .zip, .gz files.
1] I want to find all .zip/.gz files from folder (C:\shellprg\input\).
2] unzip/uncompress files into the same folder (C:\shellprg\input\) through shell script.

I am using below commands for unzip files,
Code:


unzip <filename>
gzip -d <filename>

Could you please help me out.
Thanks in advance.:confused:

jafersalam 8Oct2013 02:03

Re: How to unzip files from folder in shell script (ksh)
 
You can use the following script to unzip/uncompress the zipped / compressed files

Code:

for zipfile in *.zip
do
          unzip $zipfile
          rm -rf $zipfile
done

try this out :)


All times are GMT +5.5. The time now is 01:52.