Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Posting-Version: version B 2.10.1 6/24/83; site teltone.UUCP
Path: utzoo!linus!vaxine!wjh12!genrad!decvax!harpo!eagle!mhuxl!ihnp4!alberta!ubc-vision!uw-beaver!teltone!stan
From: stan@teltone.UUCP ()
Newsgroups: net.unix
Subject: Re: Shell programming style -- a plea for better shell scripts
Message-ID: <239@teltone.UUCP>
Date: Sat, 11-Feb-84 21:25:05 EST
Article-I.D.: teltone.239
Posted: Sat Feb 11 21:25:05 1984
Date-Received: Wed, 15-Feb-84 00:33:03 EST
References: <5684@mcvax.UUCP> <226@teldata.UUCP>
Organization: Teltone Corp., Kirkland, WA
Lines: 23

> From: mce@teldata.UUCP (Brian McElhinney)
>
> *Sigh*  I agree that sh is much more portable, but reading sh scripts
> is painful...  "case" and "esac"???  UNIX supports C, a standard UNIX
> shell should at least resemble C.  I never have understood why the Bourne
> shell looks like Algol.  (Not that I think a change is possible, just that
> this is one more reason UNIX is not easily accepted)

Instead of  case ... in ... esac you can do

case X
{
  X)
  .
  .
}

You can also replace the   for .. [ in ... ]  do  ... done
with   for .. [ in ... ]  {  ... }.
This doesn't work for the while loop though (darn!).

This works on 4.1bsd and Venix Bourne shells, but I don't know how
portable it is to other versions.