Path: utzoo!utgpu!news-server.csri.toronto.edu!clyde.concordia.ca!uunet!cs.utexas.edu!chinacat!chip From: chip@chinacat.Unicom.COM (Chip Rosenthal) Newsgroups: comp.unix.questions Subject: Re: What's wrong with this Bourne shell script? Message-ID: <1474@chinacat.Unicom.COM> Date: 12 Aug 90 20:47:33 GMT References: <1990Aug6.172225.20319@iwarp.intel.com> <850@jonlab.UUCP> <9116@jpl-devvax.JPL.NASA.GOV> Organization: Unicom Systems Development, Austin, TX Lines: 21 In article <9116@jpl-devvax.JPL.NASA.GOV> lwall@jpl-devvax.JPL.NASA.GOV (Larry Wall) writes: >In article <850@jonlab.UUCP> jon@jonlab.UUCP (Jon H. LaBadie) writes: >: ls -ld | addcol -4 >: [or] >: TOTAL=`cat * | wc -c` >[ls messes up on non-regular files; cat is inefficient] If you snarfed the "stat" program I posted to alt.sources recently, I'd suggest: echo 0`stat -s * | sed -e 's/.*:/+/'` | bc or if you have Jon's addcol, even simpler: stat -s * | addcol -2 -- Chip Rosenthal | You aren't some icon carved out chip@chinacat.Unicom.COM | of soap, sent down here to clean Unicom Systems Development, 512-482-8260 | up my reputation. -John Hiatt