[Discuss] through the looking glass

Mike Small smallm at sdf.org
Thu Jun 7 12:45:06 EDT 2018


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



More information about the Discuss mailing list