Subject: Re: Re: /bin/sh and case and (*^*)
To: Simon Burge <simonb@netbsd.org>
From: Bruce Korb <bruce.korb@gmail.com>
List: tech-userlevel
Date: 05/04/2006 06:58:48
Sorry.  I didn't used to have to press the "plain text" button and
didn't notice.

On 5/4/06, Simon Burge <simonb@netbsd.org> wrote:
> Please do not post HTML (or mixed/alternative) mails to NetBSD.org
> mailing lists.
>
> Could you please re-post the message below in ascii-only format?
>
> Thanks,
>
> Simon.
> (tech-userlevel-owner)

> > On 5/3/06, David Laight <david@l8s.co.uk> wrote:
> > >
> > > On Fri, Apr 28, 2006 at 03:37:50PM -0700, Bruce Korb wrote:
> > > >
> > > > These do (or should):
> > > >
> > > > foo=3D3D$(case "$str" in (pat) echo pat ;; esac)
> > > > foo=3D3D`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.
> >
> >
> > It should not.  If it is part of a pattern, it would need to be quoted.
> > If it is quoted, it won't participate in the paren balancing process us=
ed
> > in the $(...) construct.  Anyway,  it is fallout from the need for bala=
ncing
> > parentheses inside that new way of inserting stdout into script text.
> >
> > > 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 ver=
y
> > > difficult) to implement in other shells, and not necessarily even
> > > desirable behaviour.
> >
> >
> > Meaning David Korn?  Yes, he's been an active participant.  So have the=
 BASH
> > folks.  I'm pretty much apolitical and would rather see one open source
> > upward-from-Bourne compatible shell project, licensed as needed for a
> > particular
> > distribution (NetBSD or OpenBSD or FreeBSD or Linux or GNU/Linux or
> > GNU/Hurd or whatever in heck).  I guess I'm actually heretical to all
> > camps.... :)
> >
> > Cheers - Bruce