What's wrong with this Bourne shell script?

George Turczynski george at hls0.hls.oz
Mon Aug 6 11:00:47 AEST 1990


In article <1990Aug3.193231.3166 at silma.com>, aab at silma.com (Andy Burgess) writes:

> ...
> 
> While you're at it, is there a better way to get the total bytes
> of the files in a directory?

You could try something like this:

ls -ld * | awk '{ sum+= $4 } END { print sum }'

It does a similar thing to what your script is supposed to do.

Hope this is of some interest to someone...

George P. J. Turczynski.          | ACSnet: george at highland.oz
                                  | Phone: 61 48 683490
Computer Systems Engineer.        | Fax:   61 48 683474
                                  |----------------------
Highland Logic Pty. Ltd.          | I can't speak for the
Suite 1, 348-354 Argyle Street    | company, I can barely
Moss Vale. NSW. 2577 Australia    | speak for myself...



More information about the Comp.unix.questions mailing list