Path: utzoo!utgpu!news-server.csri.toronto.edu!mailrus!cs.utexas.edu!usc!snorkelwacker!paperboy!meissner From: meissner@osf.org (Michael Meissner) Newsgroups: comp.unix.shell Subject: Re: sh vs. sh5 in ultrix Message-ID: Date: 4 Sep 90 03:14:22 GMT References: <3865@umbc3.UMBC.EDU> Sender: news@OSF.ORG Organization: Open Software Foundation Lines: 51 In-reply-to: rouben@math13.math.umbc.edu's message of 3 Sep 90 03:11:15 GMT In article <3865@umbc3.UMBC.EDU> rouben@math13.math.umbc.edu writes: | In a previous article Michael Meissner writes: | >> How common are sh's that don't understand shell functions? | > | > Anything that is BSD based without adding from System V. For example, | > the Ultrix DECstation that I'm posting from has the musty BSD shell as | > /bin/sh and the System V.2 shell with shell functions as /bin/sh5. | > Another problem with the BSD shell Ultrix uses, is that test (aka '[') | > is a separate command that you have to fork/exec to get to -- I | > suspect echo is too..... | | In spite of its shortcommings, ultrix's BSD sh beats sh5 in terms of | efficiency. On a DECstation5000, we have: | ls -l /bin/sh /usr/bin/sh5 | | -rwxr-xr-x 1 root system 45056 Apr 1 12:27 /bin/sh | -rwxr-xr-x 2 root system 163840 Apr 1 09:56 /usr/bin/sh5 | | So the executable for sh5 is more than three times larger than that | of sh. For quick execution of simple tasks there is a sense of | overkill in using sh5. I guess that's the reason that the folks at | DEC have not replaced sh with sh5. Just about every 'simple' shell script that I have uses test and/or echo. If there are any savings in the V7 shell, they just got lost by having to do a fork/exec combination. Also, I remember that when V.2 came out, people measured the 'new' shell with the V.1 shell which was more or less the V7 shell, and found by doing a reimplementation, it made the 'new' shell much faster. I don't remember the numbers, but it was something like 20% faster, even after factoring out the builtins. I finally sovled the problem Guy Harris mentioned in another article (ie, do you gunk up your shell scripts with #! /bin/sh5 and make them completely non-portable), by noticing that for the machines I care about, the Korn Shell was installed in /usr/bin, so I now tend to use #! /us/bin/ksh, which is still a kludge. I happen to think that System V integration was real low priority on Ultrix. All you have to do is look at how they botched curses (requiring you to change the source to include cursesX.h instead of curses.h). Sun did a much better job of mixing the two. -- Michael Meissner email: meissner@osf.org phone: 617-621-8861 Open Software Foundation, 11 Cambridge Center, Cambridge, MA, 02142 Do apple growers tell their kids money doesn't grow on bushes?