Alexander Klimov writes:
> On some systems /bin/sh is not Burne Shell, e.g. /bin/sh is tcsh, but
> there is /bin/sh5.
/bin/sh is a Bourne shell on Ultrix, just a particularly old and wacky
one.
> It is looks like there is already knowledge about it in
> the system: Makefile.ultrix4 has `SHELL=/bin/sh5' in it, but configure
> thinks something else: config.status has `s%@SHELL@%/bin/sh%g'.
Autoconf inserts this automatically because some makes inherit the value
of SHELL from the environment, which is a silly thing to do. We don't use
this because we use GNU make.
> The result of the mess is that scripts like initdb are installed with
> `#!/bin/sh', but they has function definition and tcsh complain about
> usage of '('.
No, the Ultrix shell simply doesn't support shell functions. AFAIK it's
the only Bourne shell still on the planet that does that. The short
answer might be not to use shell functions. The one in initdb could
probably be replaced by a trap. But the Ultrix /bin/sh is broken in
subtle and weird ways beyond that and it's too much effort to work around
this. Even the autoconf guys think so these days.
A better answer would probably be making the #! /bin/sh substitutable.
--
Peter Eisentraut peter_e@gmx.net http://funkturm.homeip.net/~peter