On 12/31/2021 10:53 AM, Adam Thornton wrote:
Slightly older, but also slightly more fundamental to
the system, you
need look no farther than Solaris's `/bin/sh` for an illustrated
example of the pros and cons of maintaining backwards compatibility.
It was a pain by, say, 2007, to have to check if you were running on
SunOS and use `/usr/xpg4/bin/sh` (IIRC) if you wanted a POSIX
shell--by that point the other major vendors (and Linux) had something
POSIX as the default shell. But Sun had an installed user base with a
bunch of shell scripts that depended on pre-POSIX semantics.
Did some checking, at the risk of going off-topic:
Solaris 11.4 (current patch level, 11.4.40.107.3, December 2021):
/bin/sh looks to be Korn shell.
root@mercury:~# ls -l /bin/sh
-r-xr-xr-x 5 root bin 2946936 Dec 22 10:46 /bin/sh
root@mercury:~# strings /bin/sh | grep Korn | head -1
][-author?David Korn <dgk(a)research.att.com>][-copyright?Copyright (c)
1982-2021 AT&T Intellectual
Property][-license?http://www.eclipse.org/org/documents/epl-v10.html][--cat…
root@mercury:~# sh --version
version sh (AT&T Research) 93u+ 2012-08-01
Solaris 11.3: /bin/sh seems to be Korn shell.
medusa# ls -l /bin/sh
lrwxrwxrwx 1 root root 11 Jun 11 2016 /bin/sh -> amd64/ksh93
medusa# ls -lL /bin/sh
-r-xr-xr-x 8 root bin 2601344 Jul 1 2016 /bin/sh
medusa# strings !$ | grep dgk | head -1
strings /bin/sh | grep dgk | head -1
][-author?David Korn <dgk(a)research.att.com>][-copyright?Copyright (c)
1982-2016 AT&T Intellectual
Property][-license?http://www.eclipse.org/org/documents/epl-v10.html][--cat…
medusa# sh --version
version sh (AT&T Research) 93u+ 2012-08-01
Solaris 10: (seems /bin/sh is still Bourne at this point):
zeus<(a)medusa.kilonet.net># ls -l /bin/sh
lrwxrwxrwx 1 root root 13 Jun 6 2014 /bin/sh ->
../../sbin/sh
zeus<(a)medusa.kilonet.net># ls -lL /bin/sh
-r-xr-xr-x 1 root root 82456 Sep 22 2010 /bin/sh
sh --version just opens a new shell.