help-bash
[Top][All Lists]
Advanced

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

Re: ${param+x} ?


From: lacsaP Patatetom
Subject: Re: ${param+x} ?
Date: Tue, 19 Dec 2023 12:12:46 +0100

Le mar. 19 déc. 2023 à 12:03, Davide Brini <dave_br@gmx.com> a écrit :

> On Tue, 19 Dec 2023 11:38:50 +0100, lacsaP Patatetom <patatetom@gmail.com>
> wrote:
>
> > this form `${param+x}` is not documented (man) but is accepted by bash
> and
> > differs from `${param:+x}` :
>
> It IS documented:
>
> When not  performing  substring  expansion,  using the forms documented
> below (e.g., :-), bash tests for a parameter that is unset or null.
> Omitting the colon results in a test only for a parameter that is unset.
>
> --
> D.
>
>
"Omitting the colon results in a test only for a parameter that is unset."
oh yes, I missed it ! :-(

so, what's the point of this test `[ -z ${param+x} ]`, which will always be
true ?


reply via email to

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