bug-bash
[Top][All Lists]
Advanced

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

Re: simple bug/compat question


From: Chet Ramey
Subject: Re: simple bug/compat question
Date: Tue, 20 Jan 2009 16:45:33 -0500
User-agent: Thunderbird 2.0.0.19 (Macintosh/20081209)

Linda Walsh wrote:
> Am running an older bash version and this may be fixed (assuming it
> is a bug and I'm not confused...:-))
> 
> bash version = 3.2.39(20)
> 
> This works:
> 1)    if [  -n ""  -a 2 -gt 1 ] ; then echo one;fi
> 
> This does not:
> 2)    if [[  -n ""  -a 2 -gt 1 ]] ; then echo one;fi

It's not a bug.  test/[ uses -a and -o for `and' and `or'; the
conditional command uses && and || for that purpose.  This is
they way it's documented.

Chet
-- 
``The lyf so short, the craft so long to lerne.'' - Chaucer

Chet Ramey, ITS, CWRU    address@hidden    http://cnswww.cns.cwru.edu/~chet/




reply via email to

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