what do I need?

blinux-mail at AegisInfoSys.com blinux-mail at AegisInfoSys.com
Sat Mar 6 02:11:13 UTC 2010


On Fri, Mar 05, 2010 at 13:52:44PM -0600, Tim Chase wrote:
> 
>    for f in *.zip; do unzip "$f"; done
> 
> should do the trick.  (I also like to put the "$f" in 
> double-quotes in case any of my file-names have spaces in them).

There are still possible gotchas, a non-rarity being a file that
has a dash ("-") as the first character; you'd then guard against
that by substituting "$f" with "./$f".  There are probably others ...

Sometimes when a loop is inconvenient, the "xargs" command is used instead:

     ls *.zip | xargs -n1 unzip

As noted elsewhere in this thread, the idea of unzipping multiple files
all into the same relative directory may not yield desired results.

-- 
Henry Yen                                       Aegis Information Systems, Inc.
Senior Systems Programmer                       Hicksville, New York




More information about the Blinux-list mailing list