configure shell game

Theo de Raadt deraadt at openbsd.org
Wed Jun 3 01:45:17 AEST 2026


Nico Williams <nico at cryptonector.com> wrote:

> On Tue, Jun 02, 2026 at 11:28:07PM +1000, Darren Tucker via openssh-unix-dev wrote:
> > I was recently reminded of this nonsense from the Solaris /bin/sh while
> > running a regression test:
> > 
> > run test proxy-connect.sh ...
> > [...]/proxy-connect.sh: warning: line 6: `...` obsolete, use $(...)
> > [...]/proxy-connect.sh: warning: line 6: `...` obsolete, use $(...)
> > [...]/proxy-connect.sh: warning: line 15: `...` obsolete, use $(...)
> 
> Nowadays $() is POSIX.  Is there any supported system where /bin/sh does
> not support $()?

Yes.

> If not then changing the scripts to use $() sounds
> like a worthwhile change, but finding the answer to that question may
> not be easy.

It sounds like Solaris "sh" performs the `` action correctly, but the
problem is that it sends a warning message onto fd 2. It seems to be
assuming that fd 2 is directly facing a user and will not affect the
shell script.  That is misguided.  It is very common in shell script
programming for fd2 to be redirected and checked by the script itself.
I think Solaris should reconsider this bad choice, and remove the
warning message because `` is being performed correctly.  This warning
message is not helping anyone, and Unix lacks a reliable method to
deliver a message to a user (as /dev/tty or syslog(3) have their own
issues).



More information about the openssh-unix-dev mailing list