[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [BUG] false positive: [ ! -o optname ]
From: |
isabella parakiss |
Subject: |
Re: [BUG] false positive: [ ! -o optname ] |
Date: |
Sun, 25 Sep 2016 23:40:15 +0200 |
On 9/25/16, Martijn Dekker <martijn@inlv.org> wrote:
> The '!' operator in the legacy test/[ builtin does not invert the result
> of the -o operator. Consequently the command
>
> [ ! -o noclobber ]
>
> amounts to a no-op, always returning exit status 0.
>
> Proof:
>
> $ set -o noclobber && [ -o noclobber ] && [ ! -o noclobber ] && echo bug
> bug
>
> Interestingly, mksh has this bug as well, though not the original pdksh.
>
> Thanks,
>
> - M.
>
>
[ ! -o noclobber ] means
is '!' a non empty string? if not, is 'noclobber' a non empty string?
---
xoxo iza