Donn Terry <[EMAIL PROTECTED]> writes:
> On a related topic: I'm fighting a bug in the gcc build process right
> now that is caused directly by the lack of the posix $() construct.
> (It's exactly the need to be able to do $(...$(...)...) , which can't be
> done with backtick (`) in any reasonable way in the presence of quoting
> and multiple levels of argument passing to subshells.)
> From my point of view, although using functions would be nice, allowing
> $() is far more useful and necessary, because in some instances there is
> no reasonable alternative.
Please don't use $(); Solaris /bin/sh does not support it (even in current
versions of Solaris). It's definitely significantly less portable than
shell functions.
shelby:~> /bin/sh
$ uname -a
SunOS shelby.Stanford.EDU 5.7 Generic_106541-10 sun4u sparc SUNW,Ultra-1
$ echo $(echo blah)
syntax error: `(' unexpected
I don't have a Solaris 8 machine on hand to check, but I don't believe
this has changed in Solaris 8 either. IRIX 6.5 also does not support
this:
firebird-image:~> /bin/sh
$ uname -a
IRIX firebird-image 6.5 07151432 IP22
$ echo $(echo blah)
$(echo blah)
--
Russ Allbery ([EMAIL PROTECTED]) <http://www.eyrie.org/~eagle/>