[Top][All Lists]

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

Re: -eq and strings

From: Chet Ramey
Subject: Re: -eq and strings
Date: Sat, 4 Mar 2017 13:09:01 -0500
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:45.0) Gecko/20100101 Thunderbird/45.7.1

On 3/4/17 7:15 AM, Rob la Lau wrote:
> Hello,
> I'm not sure whether I found a bug in Bash or in it's documentation.
> The documentation suggests that the arithmetic binary operator '-eq' is
> for integers ("Arg1 and arg2 may be positive or negative integers."),
> but when using it with '[[ ]]' it doesn't fail on strings.

When used with [[, the arithmetic operators take arithmetic expressions as
their arguments.  I'll add something noting this to the documentation.
Thanks for the report.

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

reply via email to

[Prev in Thread] Current Thread [Next in Thread]