Okay...here's some ideas.

The best way to probably do this is to learn how to use the find
command.  It's complicated but should allow you to do this without
shell scripting or Perl (which imho is always better than shell
scripting).  Even find by itself will give you what you were trying to
do with ls.

You could also try the poor man's version...which would be this.  I
can't guarantee it will work, and don't have anywhere to test it, but
it sounds like it should.

tar -xzf */*/*.tar.gz

Good luck!
-Sam

On Thu, Sep 05, 2002 at 07:28:11PM -0400, [EMAIL PROTECTED] wrote:
> This is in the "There has to be an easy way to do this" category-
> 
> I have a directory which contains several subdirectories, each of which
> contains over 100 subdirectories, each of which contains at least one *.tar.gz file. 
> I would like to extract all the tarballs in the directories where they are now, 
> and keep the directory structure intact. 
> 
> (If the people who set up the CD had tarred it properly, I wouldn't have this 
>problem.)
> 
> I'm looking for a command or script which would work from the top dir like:
> 
>     $ tar -Rxz *.tar.gz
> 
> would work if it worked that way, which of course it won't, since -R is an invalid 
>option for tar.
> 
> In english: 
> "Descend though all subdirectories from the present directory, 
> and extract all tar.gz files right where they sit."
> 
> I looked at piping the output from ls, but it only outputs filenames, not the 
>required paths,
> so I don't even know where to start with writing a script.
> 
> Any ideas?
> 
> -- 
> -----------------------------------------------------------
> Carl Brown [EMAIL PROTECTED]
> ------------------------------------------------------
> -----
> 
> 
> 
> -- 
> redhat-list mailing list
> unsubscribe mailto:[EMAIL PROTECTED]?subject=unsubscribe
> https://listman.redhat.com/mailman/listinfo/redhat-list

-- 
Sam Ockman, Chairman and CEO
Tel:  415-358-2600   Fax:  415-896-6742   Toll Free:  888-PENGUIN
PENGUIN COMPUTING - Simplifying the Solution Process [tm]
www.penguincomputing.com     



-- 
redhat-list mailing list
unsubscribe mailto:[EMAIL PROTECTED]?subject=unsubscribe
https://listman.redhat.com/mailman/listinfo/redhat-list

Reply via email to