On 3/14/11 2:38 AM, Peggy Russell wrote:

> This helps clarify the "set -x" difference below which show $r going through
> parameter expansion done by the shell before the command [[ sees the 
> expression.
> Okay...
> 
> command [[ that            
> contains expr               set -x
> ---------------         --------------
> [[ $? -eq r ]]          + [[ 0 -eq r ]]  * [[ used the contents of r which 
> was 0
> [[ $? -eq $r ]]         + [[ 0 -eq 0 ]]
> [[ $? -eq ${r:=0} ]]    + [[ 0 -eq 0 ]]
> 
> For a user to see/trace r, they would either echo/printf, declare -p r,
> or refer to it as $r (displayed by set -x).  

Yes.

> Can users see more trace info on what happens within [[ (i.e.; [['s value for 
> r)?

No.

-- 
``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