[Top][All Lists]

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

Re: How to test if a variable is declared?

From: Peng Yu
Subject: Re: How to test if a variable is declared?
Date: Fri, 13 Mar 2020 09:51:40 -0500

On Fri, Mar 13, 2020 at 9:25 AM John McKown <address@hidden>

> On Fri, Mar 13, 2020 at 9:01 AM Peng Yu <address@hidden> wrote:
>> I am trying to use bash efficiently. I am not saying that I have seen CPU
>> as a concern in a real application. But I want to avoid the
>> do-something-then-discard-it approach as much as possible. Sometimes, a
>> solution can be found in bash. Sometimes, it can’t be done as in this case
>> at this moment. Either way is fine with me. But I need to know where the
>> limit is of bash.
>> For this specific case, I don’t think that bash could not support it.
>> After
>> all, it could be supported for example by adding a new switch to [[.
> Or maybe a "-q" (for quiet) or "-s" (for silent) as a "suboption" for
> declare -p (declare -pq variable) so that it only sets $?

That also could be a possibility.

>> Peng
> --
> People in sleeping bags are the soft tacos of the bear world.
> Maranatha! <><
> John McKown

reply via email to

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