On Fri, Sep 16, 2016 at 12:30:59PM -0700, Eric Pruitt wrote:
> > That, or ${VAR:+not empty} which is how I suggest testing for variable
> > set-and-not-empty-ness.
>
> I'm aware of that construct, but that doesn't do what I want unless I'm
> missing something; I don't want to change the value of the variable.

Actually, I misunderstood what you wrote when I skimmed your message the
first time. However, that construct still won't work because if a
variable is defined, it will still choose "not empty:"

    ericpruitt@sinister:~$ X=
    ericpruitt@sinister:~$ echo ${X+Not empty}
    Not empty
    ericpruitt@sinister:~$ X=XXX
    ericpruitt@sinister:~$ echo ${X+Not empty}
    Not empty

Eric

Reply via email to