bug-bash
[Top][All Lists]
Advanced

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

Re: variable name and its' value are the same characters causes recursio


From: Chet Ramey
Subject: Re: variable name and its' value are the same characters causes recursion error
Date: Thu, 10 Mar 2011 09:23:24 -0500
User-agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US; rv:1.9.2.13) Gecko/20101207 Thunderbird/3.1.7

On 3/10/11 8:14 AM, Greg Wooledge wrote:
> On Thu, Mar 10, 2011 at 10:18:26AM +0800, Clark J. Wang wrote:
>> Actually I don't like the recursion here. Does POSIX require that?
>>
>>> For example:
>>>
>>> unset a; declare a="a"; [[ a -lt 3 ]]; echo $?
>>> bash: [[: a: expression recursion level exceeded (error token is "a")
>>> 1
> 
> POSIX doesn't even have a [[ command.  This is all bash.

Not really.  There is substantial agreement among shells that implement
arithmetic expansion.  bash, ksh93, zsh, mksh (and other pdksh derivatives
that implement `[[') all behave the same way.  For the most part, it's the
same way with `['; zsh is a notable exception there.

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



reply via email to

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