Path: utzoo!attcan!uunet!samsung!usc!elroy.jpl.nasa.gov!jpl-devvax!lwall From: lwall@jpl-devvax.JPL.NASA.GOV (Larry Wall) Newsgroups: comp.unix.questions Subject: Re: What's wrong with this Bourne shell script? Message-ID: <9053@jpl-devvax.JPL.NASA.GOV> Date: 7 Aug 90 20:31:20 GMT References: <1990Aug3.193231.3166@silma.com> <1990Aug5.123522.28149@cbnewsj.att.com> Reply-To: lwall@jpl-devvax.JPL.NASA.GOV (Larry Wall) Organization: Jet Propulsion Laboratory, Pasadena, CA Lines: 37 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? In article <1990Aug6.172225.20319@iwarp.intel.com> merlyn@iwarp.intel.com (Randal Schwartz) writes: : : 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";' * In article scott@tab29.larc.nasa.gov (Scott Yelich (ODU) ) writes: : : However, I fiddle around with SH scripts... and this is how I would hack : your script: : : 1) I would not do it in perl-- I hate it when people ask about bourne : shell and other people reply with perl.... I refrain from labeling this as Irrational Prejudice, but it sure looks like it. In the first place, the command Randal gave is a *perfectly valid* Bourne shell script. In the second place, Andy asked if there was a better way. Even if *you* don't think it is a better way, you shouldn't try to keep other people from helping. I hate it when people think we're espousing Perl as the One True Way. Perl is just another tool. Use where appropriate. Don't use where not. Those are my Irrational Prejudices. Larry Wall lwall@jpl-devvax.jpl.nasa.gov