Relative speed of Bourne vs. C Shells - C Shell is faster.

Mike Tiberio tiberio at seismo.UUCP
Wed Mar 27 01:52:59 AEST 1985


I too am sick and tired of hearing about how much faster the bourne shell
is than the C shell. On a heavily loaded VAX my C shell scripts always run
faster, and when the load drops to around 1 the two shells seem to run neck
and neck. Some people say bourne shell is easier to program, come on, does
"if test $# -gt 1" really look better than "if ($#argv > 1)" and tell me you
don't cringe every time you type esac and fi (yuk yuk). Here are two shell
scripts (made to make tail act like head) go ahead, run em, make my day..
---seismo!tiberio

XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
#! /bin/sh
case $1 in
	-*) O=$1;shift
esac
for F
do
	if test $# -gt 1
	then	echo "";echo ==\> $F \<==
	fi
	/usr/ucb/tail $O $F
done
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
#! /bin/csh -f
set O
switch ($1)
	case -*:
		set O=$1;shift
endsw
foreach F ($*)
	if ($#argv > 1) then
		echo "";echo ==\> $F \<==
	endif
	/usr/ucb/tail $O $F
end
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX



More information about the Comp.unix.wizards mailing list