Subject: Re: Re: /bin/sh and case and (*^*)
To: Simon Burge <firstname.lastname@example.org>
From: Bruce Korb <email@example.com>
Date: 05/04/2006 06:58:48
Sorry. I didn't used to have to press the "plain text" button and
On 5/4/06, Simon Burge <firstname.lastname@example.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?
> > On 5/3/06, David Laight <email@example.com> 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=
> > in the $(...) construct. Anyway, it is fallout from the need for bala=
> > 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=
> > > 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=
> > 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