Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > gnu.bash.bug > #15254

Re: T/F var expansion?

Path csiph.com!goblin1!goblin.stu.neva.ru!usenet.stanford.edu!not-for-mail
From L A Walsh <bash@tlinx.org>
Newsgroups gnu.bash.bug
Subject Re: T/F var expansion?
Date Mon, 29 Jul 2019 00:57:55 -0700
Lines 36
Approved bug-bash@gnu.org
Message-ID <mailman.100.1564387084.1985.bug-bash@gnu.org> (permalink)
References <5D3E7367.8050308@tlinx.org> <20190729070111.3342a96938ec9d530679a268@schrader-schulte.de> <5D3EA703.904@tlinx.org>
NNTP-Posting-Host lists.gnu.org
Mime-Version 1.0
Content-Type text/plain; charset=UTF-8
Content-Transfer-Encoding 7bit
X-Trace usenet.stanford.edu 1564387084 1799 209.51.188.17 (29 Jul 2019 07:58:04 GMT)
X-Complaints-To action@cs.stanford.edu
Cc bug-bash <bug-bash@gnu.org>
To Martin Schulte <gnu@schrader-schulte.de>
Envelope-to bug-bash@gnu.org
User-Agent Thunderbird
In-Reply-To <20190729070111.3342a96938ec9d530679a268@schrader-schulte.de>
X-detected-operating-system by eggs.gnu.org: GNU/Linux 2.2.x-3.x (no timestamps) [generic]
X-Received-From 173.164.175.65
X-BeenThere bug-bash@gnu.org
X-Mailman-Version 2.1.23
Precedence list
List-Id Bug reports for the GNU Bourne Again SHell <bug-bash.gnu.org>
List-Unsubscribe <https://lists.gnu.org/mailman/options/bug-bash>, <mailto:bug-bash-request@gnu.org?subject=unsubscribe>
List-Archive <https://lists.gnu.org/archive/html/bug-bash>
List-Post <mailto:bug-bash@gnu.org>
List-Help <mailto:bug-bash-request@gnu.org?subject=help>
List-Subscribe <https://lists.gnu.org/mailman/listinfo/bug-bash>, <mailto:bug-bash-request@gnu.org?subject=subscribe>
X-Mailman-Original-Message-ID <5D3EA703.904@tlinx.org>
X-Mailman-Original-References <5D3E7367.8050308@tlinx.org> <20190729070111.3342a96938ec9d530679a268@schrader-schulte.de>
Xref csiph.com gnu.bash.bug:15254

Show key headers only | View raw



On 2019/07/28 22:01, Martin Schulte wrote:
> Hello!
>   
>> Is there a T/F var expansion that does:
>>     var=${tst:+$yes}${tst:-$no}
>> but with yes/no in 1 expansion?
>>     
>
> At least if you are only working with numbers you can use
> ((var=(tst!=0?42:31)))
> But is this a question for bug-bash?
> Best regards,
> Martin
>   
----
    I'm familiar with the numeric form, and many times have lamented the
lack of a similar form for non-numeric data.

    The fact that bash provides such a feature for numbers but not
for strings, seems like a missing feature. Depending on whether or
not you expected or wanted a language to provide similar operators for
the various types of data it can process such a deficit might be felt
to be a sufficient problem to warrant a solution. Wouldn't it be
the case that the lack of such a feature became a "type" of bug
that required, to the extent it was wanted,  a "fix"? 

    That said, I'm pretty sure that ideas for bash don't have to be
existing bugs in order to be considered something that might qualify
for a code addition or update.

-l


Back to gnu.bash.bug | Previous | Next | Find similar | Unroll thread


Thread

Re: T/F var expansion? L A Walsh <bash@tlinx.org> - 2019-07-29 00:57 -0700

csiph-web