> Eric> $ k=$(case x in (x) :; esac)
> Huh, they only taught us ) in school.
> Is () since Bell Labs days too?

POSIX requires shells to support case x in (x), but older
bourne shells do not support this newer syntax.  That is
probably why you were not taught it; if I understand
correctly, it was invented in ksh, then standardized by
POSIX, which is why bash now has it.  At any rate,
several platforms, including Solaris' /bin/sh, still do not
parse ( in case patterns even today, so it is certainly
not portable if you don't have access to a POSIX shell.

> P.S. I didn't test <<\EOF with ")" itself as the EOF marker,
> <<\( maybe. You can... Reply-To: bug-bash@gnu.org, [EMAIL PROTECTED]

Indeed, this points out another (probably related) parsing
problem in bash 3.1:

Buggy (here-doc delimiter treated as $() closer):
$ echo $(
> cat << ')'
> hello
> )
hello

Expected:
$ echo $(
> cat << ')'
> hello
> )
> )
hello

--
Eric Blake


_______________________________________________
Bug-bash mailing list
Bug-bash@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-bash

Reply via email to