Re: [External] : configure shell game
Jan Pechanec via openssh-unix-dev <[email protected]> Tue, 2 Jun 2026 17:56:18 +0200
| Newsgroups | gmane.network.openssh.devel |
|---|---|
| Message-ID | <ah79Iji/Fb+JTIVq@len49> |
On Tue, Jun 02, 2026 at 10:28:41AM -0500, Nico Williams wrote: > On Tue, Jun 02, 2026 at 05:11:44PM +0200, Jan Pechanec via openssh-unix-dev wrote: > > /bin/sh on Solaris 11+ is ksh93 which considers ``, and documents it in > > its man page, as obsolete. Retrospectively, using ksh93 as /bin/sh was > > not a good decision but it would be close to imposible to change it now. > > I thought ksh93 recognizes when it's invoked as 'sh' and tries to act as > a POSIX shell in that case. Unless its POSIX mode is incomplete in > obnoxious ways I wouldn't say it was a mistake to make ks93 /bin/sh. (I > do think it was a mistake though.) No, ksh93 does not work like that, running it as /bin/sh does not change its behavior. Well, unless it would be something hidden in the code and undocumented. It's posix mode is complete, I believe (well, likely not with the latest one from 2024), but to make it short, the biggest problem to have it for /bin/sh is that it has too many features for that, and bugs keep showing up. And there is no compatible upstream with the original ksh93. I believe that dash is a great replacement for /bin/sh when the situation allows it. > > > We seriously considered that but as it would likely break large amount > > of existing user scripts using ksh93 features without explicitly calling > > /bin/ksh in the shebang, we decided against that. > > I commend you for not making such a breaking change. > > > ksh93 issues the warning with the -n option, which is used in > > test-exec.sh. And it does not distinguish between syntax errors and > > warnings. > > Syntax errors don't cause /bin/sh -n to exit with an error? Or warnings > cause it to exit with an error? The former would be quite bad and worth > fixing; the latter would be quite obnoxious and also worth fixing. It works as expected - syntax errors make ksh93 exit with a non-zero, and warnings are non-errors. However, you cannot say "be quiet on non-errors" so you will always get those warnings with -n. > The warning message is somewhat useful: $() is POSIX now, and $() is > much better than ``. I agree but it's "obsolete" by ksh93 only, the POSIX sh spec makes those constructs equal. > Users usually can't do anything with such warnings, which makes them > more an annoyance than anything. +1 -- Jan Pechanec <[email protected]>