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


Groups > gnu.bash.bug > #15251 > unrolled thread

Re: T/F var expansion?

Started byMartin Schulte <gnu@schrader-schulte.de>
First post2019-07-29 07:01 +0200
Last post2019-07-29 07:01 +0200
Articles 1 — 1 participant

Back to article view | Back to gnu.bash.bug

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: T/F var expansion? Martin Schulte <gnu@schrader-schulte.de> - 2019-07-29 07:01 +0200

#15251 — Re: T/F var expansion?

FromMartin Schulte <gnu@schrader-schulte.de>
Date2019-07-29 07:01 +0200
SubjectRe: T/F var expansion?
Message-ID<mailman.96.1564376479.1985.bug-bash@gnu.org>
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

[toc] | [standalone]


Back to top | Article view | gnu.bash.bug


csiph-web