[plug] bash script program help

Russell Steicke r.steicke at bom.gov.au
Wed Jan 11 09:12:18 WST 2006


On Wed, Jan 11, 2006 at 09:01:34AM +0800, Cameron Patrick wrote:

> >   function filesize() {
> >     echo $(ls -l $1 | awk '{print $5}')
> >   }
> 
> This can be done more directly using stat(1), e.g.
> 
>     filesize () {
>         stat -c %s $1
>     }

Ah, very nice.  Thanks.

And the "echo $()" was superfluous, too.  :(

> This seems to be slightly Linux-specific, though: it's there on *BSD but
> it isn't present on Solaris or Tru64.

Not on AIX 5.2, either.



-- 
Russell Steicke

-- Fortune says:
It is difficult to soar with the eagles when you work with turkeys.



More information about the plug mailing list