What's wrong with this Bourne shell script?

Larry Wall lwall at jpl-devvax.JPL.NASA.GOV
Wed Aug 8 06:31:20 AEST 1990


In article <1990Aug3.193231.3166 at silma.com>, aab at 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 at iwarp.intel.com> merlyn at 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.90Aug7090149 at tab29.larc.nasa.gov> scott at 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 at jpl-devvax.jpl.nasa.gov



More information about the Comp.unix.questions mailing list