If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > Unix Shell Scripts > Unzip the same file multiple times command

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 01-04-11, 09:18
namepro namepro is offline
Registered User
 
Join Date: Jan 2011
Posts: 1
Exclamation Unzip the same file multiple times command

Hello,

I have a folder which has files of the following format,

test.zip.zip.zip.zip.zip.zip.zip

There are like 110 files of the format.

Is there any command to unzip a file and then unzip the result from the previous step and unzip again until whole is unzipped to test.txt

Please advise.
Reply With Quote
  #2 (permalink)  
Old 01-04-11, 10:14
stolze stolze is offline
Registered User
 
Join Date: Jan 2007
Location: Jena, Germany
Posts: 2,662
You could search for all zip files in the directory, unzip the first one and move it away to some other directory. Then start from the beginning and run this loop as long as you find a .zip file.
Code:
while [ -n "`ls *.zip`" ]; do
    for i in *.zip; do
        unzip $i
        mv $i elsewhere/
    done
done
__________________
Knut Stolze
IBM DB2 Analytics Accelerator
IBM Germany Research & Development
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On