On 7/30/13 6:00 AM, Jesper Brix Rosenkilde wrote:

> Bash Version: 4.2
> Patch Level: 45
> Release Status: release
> 
> Description:
> When comparing ' a' with '0a' using the less than operator, using [ ] and
> [[ ]] tests respectively gives different results.
> 
> Repeat-By:
> [ ' a' \< '0a' ] && echo ok
> [[ ' a' < '0a' ]] && echo ok

Yes.  The description of the [[ command says

        When used with [[, the < and > operators sort  lexicographically
        using the current locale.

The description that appears in the `CONDITIONAL EXPRESSIONS' section says:

        When used with [[, the < and > operators sort  lexicographically
        using the current locale.  The test command sorts using ASCII
        ordering.

Chet
-- 
``The lyf so short, the craft so long to lerne.'' - Chaucer
                 ``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, ITS, CWRU    c...@case.edu    http://cnswww.cns.cwru.edu/~chet/

Reply via email to