Boston Linux & UNIX was originally founded in 1994 as part of The Boston Computer Society. We meet on the third Wednesday of each month, online, via Jitsi Meet.

BLU Discuss list archive


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

[Discuss] through the looking glass



Richard Pieri <richard.pieri at gmail.com> writes:

> On 6/2/2018 12:42 PM, dan moylan wrote:
>> not portable?  where would that be?
>
> Not portable in that "[[" is specific to Bash. You may not find it in
> other Bourne-derived shells.

ksh, either the real thing or one of the pdksh derived ones, has it the
same way. I'm starting to get the impression that some large number of
what people call bashisms come from David Korn (the feature not the
implemention). I was reading a book of his and he actually deprecates [
in favour of [[, mostly because, as I think you implied further up, [[
is syntax and [ just a command, so [[ ]] avoids that awful kind of error
you'll get when a variable is empty and you use it in a comparison
without the idiomatic hack to make sure an operand doesn't become .

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?"

-- 
Mike Small
smallm at sdf.org



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