Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > gnu.bash.bug > #15250 > unrolled thread
| Started by | L A Walsh <bash@tlinx.org> |
|---|---|
| First post | 2019-07-28 21:17 -0700 |
| Last post | 2019-07-28 21:17 -0700 |
| 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.
T/F var expansion? L A Walsh <bash@tlinx.org> - 2019-07-28 21:17 -0700
| From | L A Walsh <bash@tlinx.org> |
|---|---|
| Date | 2019-07-28 21:17 -0700 |
| Subject | T/F var expansion? |
| Message-ID | <mailman.91.1564373873.1985.bug-bash@gnu.org> |
Is there a T/F var expansion that does:
var=${tst:+$yes}${tst:-$no}
but with yes/no in 1 expansion?
Something like:
var=${tst:^yes^no}
| |
\___\___ or some other char(s)
with the opposite syntax being allowed as
var=${!tst:^no^yes}
(or) if '!' before the varname is unwieldy:
var=${tst:!no!yes}
----
Obviously the 1 code-snippet solves the problem, but looks
a bit redundant, at the least...
Sorry if this is already implemented in some form, I'm just
not remembering there being one.
Back to top | Article view | gnu.bash.bug
csiph-web