Boston Linux & UNIX was originally founded in 1994 as part of The Boston Computer Society. We meet on the third Wednesday of each month at the Massachusetts Institute of Technology, in Building E51.

BLU Discuss list archive


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Discuss] through the looking glass



On Thu, Jun 07, 2018 at 04:45:06PM +0000, Mike Small wrote:
> Which are the the shells that don't give you [[?  Looks like dash
> doesn't have it, from the man page (so ash too I assume). What's the
> expression, "posix me harder?"

The actual Bourne shell does not have it, nor do ash or dash (which
are basically the same shell, but IIRC dash has some few
debian-specific changes).  IIRC, Solaris 10 and earlier ship with a
/bin/sh that is closest to the Bourne shell rather than the current
spec of "POSIX" shell, and thus also do not have it.  HP-UX prior to
10.x does not have it, and I'm not sure about the POSIX shell that
ships with 10.x or later.  This list is not complete, though most of
the other entries would be for even more outdated platforms (where
/bin/sh is either exactly, or most similar to, the original Bourne
shell).

There were multiple releases of the Korn shell, notably ksh88 and
ksh93.  The former is slightly more Bourne-like, the latter is
slightly more Bash-like, but I used either only exceedingly rarely and
I'mm unsure which features are in one and not the other.

There are still at least some Bashisms that are truly unique to Bash,
though some bashisms have been copied by other shells.

If you need to write portable shell scripts, it is still safest to
limit yourself to original Bourne syntax.  Even as recently as last
month, for example, Mutt's build environment had bugs on multiple
systems because it had been modified to use Bash-specific or newer
POSIX features, and the shells on those systms lacked those features
(Solaris 10 in particular is a frequent pain point, but IIRC it is
not alone).

-- 
Derek D. Martin    http://www.pizzashack.org/   GPG Key ID: 0xDFBEAD02
-=-=-=-=-
This message is posted from an invalid address.  Replying to it will result in
undeliverable mail due to spam prevention.  Sorry for the inconvenience.




BLU is a member of BostonUserGroups
BLU is a member of BostonUserGroups
We also thank MIT for the use of their facilities.

Valid HTML 4.01! Valid CSS!



Boston Linux & Unix / webmaster@blu.org