Subject: Re: /bin/sh and case and (*^*)
To: Bruce Korb <Bruce.Korb@gmail.com>
From: David Laight <david@l8s.co.uk>
List: tech-userlevel
Date: 05/03/2006 22:55:04
On Fri, Apr 28, 2006 at 03:37:50PM -0700, Bruce Korb wrote:
> 
> These do (or should):
> 
> foo=$(case "$str" in (pat) echo pat ;; esac)
> foo=`case "$str" in (pat) echo pat ;; esac`

NetBSD's /bin/sh is known not to support the latter, and there is an
open PR about it.

I don't know where that 'alternate' syntax came from - since it isn't
historically part of the shell syntax (see solaris /bin/sh) and the
change would break scripts that contain '(' at the start of patterns.

However the Posix standard does seem to have had a lot of input from
the ksh people - to the point where some parts are impossible (ok very
difficult) to implement in other shells, and not necessarily even desirable
behaviour.

	David

-- 
David Laight: david@l8s.co.uk