Path: utzoo!utgpu!news-server.csri.toronto.edu!mailrus!cs.utexas.edu!swrinde!ucsd!ucbvax!iwarp.intel.com!news From: merlyn@iwarp.intel.com (Randal Schwartz) Newsgroups: comp.unix.questions Subject: Re: What's wrong with this Bourne shell script? Message-ID: <1990Aug6.172225.20319@iwarp.intel.com> Date: 6 Aug 90 17:22:25 GMT References: <1990Aug3.193231.3166@silma.com> Sender: news@iwarp.intel.com Reply-To: merlyn@iwarp.intel.com (Randal Schwartz) Organization: Stonehenge; netaccess via Intel, Beaverton, Oregon, USA Lines: 16 In-Reply-To: aab@silma.com (Andy Burgess) In article <1990Aug3.193231.3166@silma.com>, aab@silma (Andy Burgess) writes: | While you're at it, is there a better way to get the total bytes | of the files in a directory? perl -e 'for(@ARGV){$x += (stat($_))[7];} print "$x bytes\n";' * and soon (after the next patch): perl -e 'for(@ARGV){$x += -s;} print "$x bytes\n";' * Just another Perl hacker, -- /=Randal L. Schwartz, Stonehenge Consulting Services (503)777-0095 ==========\ | on contract to Intel's iWarp project, Beaverton, Oregon, USA, Sol III | | merlyn@iwarp.intel.com ...!any-MX-mailer-like-uunet!iwarp.intel.com!merlyn | \=Cute Quote: "Welcome to Portland, Oregon, home of the California Raisins!"=/