From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 1164f8,611a36c5530e78c5 X-Google-Attributes: gid1164f8,public From: cmr@world.std.com (Charles M Richmond) Subject: Re: Copyright irritation (OSF/1) on *everything* Date: 1995/04/05 Message-ID: #1/1 X-Deja-AN: 100802510 references: <3ll8i2$cn7@gap.cco.caltech.edu> <3lmjid$8um@topaz.sensor.com> <1995Apr3.200503.241@mbsks.franken.de> <3lrrt3$hb3@topaz.sensor.com> organization: Integrated International Systems Corp. One Longfellow Place, Suite 3309, Boston, Ma. newsgroups: comp.sys.dec ron@topaz.sensor.com (Ron Natalie) writes: >#!/bin/sh >usage="Usage: $0 [OPTION]... > --help display this help and exit > --version output version information and exit" >case $# in > 1 ) > case "z${1}" in > z--help ) > echo "$usage"; exit 0 ;; > z--version ) > echo "GNU shellutils 1.9.4"; exit 0 ;; > * ) ;; > esac > ;; > * ) ;; >esac >exit 0 If I put this in a file called ture and then execute: time (ture;ture;ture;ture;ture;ture;ture;ture;ture;ture;ture;ture;ture;ture;ture ;ture;ture;ture;ture;ture;ture;ture;ture;ture;ture;ture;ture;ture;ture;ture;ture ;ture;ture;ture;ture;ture;ture;ture;ture;ture;ture;ture;ture;ture;ture;ture;ture ;ture;ture) The result is : real 0m4.43s user 0m1.03s sys 0m3.30s Whereas Digitals 16k executable in the same circumstance is: time (true;true;true;true;true;true;true;true;true;true;true;true;true;true;true ;true;true;true;true;true;true;true;true;true;true;true;true;true;true;true;true ;true;true;true;true;true;true;true;true;true;true;true;true;true;true;true;true ;true;true) real 0m0.03s user 0m0.01s sys 0m0.01s Which is one hell of a lot faster! If I strip the weirdness out of the shell and just do #!/bin/sh exit 0 time (rute;rute;rute;rute;rute;rute;rute;rute;rute;rute;rute;rute;rute;rute;rute ;rute;rute;rute;rute;rute;rute;rute;rute;rute;rute;rute;rute;rute;rute;rute;rute ;rute;rute;rute;rute;rute;rute;rute;rute;rute;rute;rute;rute;rute;rute;rute;rute ;rute;rute) real 0m4.20s user 0m0.95s sys 0m3.13s I guess if I was putting Linux or freeBSD on a *tiny* disk drive then I might object to the extra 16k with the multi-gig system that I have ... I much prefer the 100 to 1 speed improvement. Now this applies to repetitive scripts, but there does not seem to be much else that 'true' is good for. I note that on the DS3100 that true is "an exported alias for :" and that it executes the same # of times in: real 0m0.03s user 0m0.00s sys 0m0.01s If I explicitly use /bin/true, then : real 0m4.38s user 0m0.40s sys 0m1.75s and a compiled version: real 0m1.95s user 0m0.11s sys 0m1.53s Charlie -- ***************************************************************************** * Charles Richmond Integrated International Systems Corporation * * cmr@asoko.iisc.com cmr@world.std.com * * Specializing in UNIX, X, Image Processing, and Communications. *