Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 2/19/85; site seismo.UUCP Path: utzoo!watmath!clyde!burl!ulysses!mhuxr!mhuxt!houxm!whuxl!whuxlm!akgua!gatech!seismo!tiberio From: tiberio@seismo.UUCP (Mike Tiberio) Newsgroups: net.unix-wizards Subject: Re: Relative speed of Bourne vs. C Shells - C Shell is faster. Message-ID: <1778@seismo.UUCP> Date: Tue, 26-Mar-85 10:52:59 EST Article-I.D.: seismo.1778 Posted: Tue Mar 26 10:52:59 1985 Date-Received: Thu, 28-Mar-85 06:20:42 EST References: <216@sdcc12.UUCP> <12138@watmath.UUCP> Organization: Center for Seismic Studies, Arlington, VA Lines: 35 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