bug-bash
[Top][All Lists]
Advanced

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

Re: arithmetic evaluation question


From: Chris F.A. Johnson
Subject: Re: arithmetic evaluation question
Date: Mon, 23 Jul 2001 05:18:47 GMT

On Sun, 22 Jul 2001, dino bartolome wrote:

> this is a trival bash question but i'd like to know the meaning of this line
> echo "${ac_cv_func_finite+set}"
> if the ac_cv_func_finite shell variable is set the output is "set" but if it
> is not initialized the output is nothing. What is the meaning of the +
> operator? According to the manual:
> The value of a parameter is coerced to a long integer within an expression.
> and where can I find this information in the gnu bash reference?

Look under "Parameter Expansion":

    In each of the cases below, word is subject to tilde expansion, paramĀ­
    eter  expansion, command substitution, and arithmetic expansion.  When
    not performing substring expansion, bash tests for a parameter that is
    unset or null; omitting the colon results in a test only for a parameĀ­
    ter that is unset.
[snip]
    ${parameter:+word}
          Use Alternate Value.  If parameter is null or unset, nothing is
          substituted, otherwise the expansion of word is substituted.

-- 
        Chris F.A. Johnson          bq933@torfree.net
        =================================================================
        c.f.a.johnson@home.com      http://cfaj.freeshell.org
        cfaj@freeshell.org          http://members.home.net/c.f.a.johnson



reply via email to

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