bug-bash
[Top][All Lists]
Advanced

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

Re: set -x and parameter expansion


From: Chet Ramey
Subject: Re: set -x and parameter expansion
Date: Sun, 13 Mar 2011 22:10:38 -0400
User-agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-US; rv:1.9.2.13) Gecko/20101207 Lightning/1.0b2 Thunderbird/3.1.7

On 3/13/11 8:06 PM, Peggy Russell wrote:
> I got the expected results below, but I didn't get the expected
> expansion in case (3).
> 
> I expected to see "+ [[ 0 -eq 0 ]]" and not "+ [[ 0 -eq r ]]".
> 
> With set -x, aren't the left and right parameters in a expression
> the final result of all expansions, including arithmetic expansion?

The `r' is not a word expansion.  It's a word that's evaluated as an
expression when the command is executed.  Arithmetic expansion is
the $((...)) word expansion.

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]