[KLUG Members] awk question

bill bill at billtron.com
Tue Feb 22 17:58:44 EST 2005


Right parens ")" should be curly "}"


On Tue, 2005-02-22 at 17:01, bill wrote:
> Trying to get the uncompressed size of a file I've come up with
> 
> gzip -l somezipfile.gz | awk /[0-9]+/'{print $2)'
  gzip -l somezipfile.gz | awk /[0-9]+/'{print $2}'
                                                 ^
Above (2nd line) should be correct.

> 
> Now I want to know how it works.
> 
> The output of gzip -l looks like: 
> 
>          compressed        uncompressed  ratio uncompressed_name
>          1837372631          3201867776  42.6% somefile.txt
> 
> And when I initially did 
> 
> gzip -l somezipfile.gz | awk '{print $2)'
> 
> I got
> 
> uncompressed
> 3201867776
> 
> I didn't want the "uncompressed" string, just the number.
> 
> Are those two results the result of awk outputting the second "word" of
> two lines?  I kept trying to break them up but couldn't, and ended up
> telling awk to only keep the "word" that had numbers in it.
> 
> kind regards,
> 
> bill hollett
> 
> 
> 
> 
> _______________________________________________
> Members mailing list
> Members at kalamazoolinux.org
> 
> 
> 



More information about the Members mailing list