Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Introduction to Linux - A Hands on Guide
This guide was created as an overview of the Linux Operating System, geared toward new users as an exploration tour and getting started guide, with exercises at the end of each chapter.
For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration. This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. They hope these examples will help you to get a better understanding of the Linux system and that you feel encouraged to try out things on your own.
Click Here to receive this Complete Guide absolutely free.
Well you could move your zip file to another directory everytime you inzipped it and check if there are anymore zips available.
while ls *.zip >/dev/null
for i in *.zip
# unzip $i
# move $i to another directory
This piece of shell script should do something alike. You need the nested loop, because the contents of your directory changes after every iteration. So if you would only loop the innermost loop you would only extract the zips currently in the directory. The new zips would not get extracted, so the outermost loop ensures everytime a new zip pops up, it will get extracted.
Of course it would be better to not move the old zip files(), but extract the first zip to some directory and only extract and (re)move the new zips from there.
Since that's exactly what he asked for, it isn't really a problem, is it? Very few zip files have more than a 2 or 3 levels of nesting anyway.
He asked for all levels to be expanded; he didn't ask for it to
attempt e.g 100 iterations if there happen to be 100 zips in
the directory structure (none of which will -hopefully- have a
100 levels of zips nested).
It's not a "problem", anyway, it just does way more work than I
think is necessary to solve his problem.
Sorry about that, but it won't be an endless loop if /home/knoppix/blah really unzips the files it is given. For then, the zip files processed will have vanished when the next "ls -R | grep [.]zip" is issued.