Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.os.linux.misc > #11222
| From | Eric Pozharski <whynot@pozharski.name> |
|---|---|
| Newsgroups | comp.os.linux.misc |
| Subject | Re: need bash indirect variable help |
| Date | 2014-06-08 12:19 +0300 |
| Organization | Aioe.org NNTP Server |
| Message-ID | <slrnlp8alv.f8o.whynot@orphan.zombinet> (permalink) |
| References | <lmvmr3$oqu$1@dont-email.me> <ln081j$1nl$3@dont-email.me> |
with <ln081j$1nl$3@dont-email.me> William Unruh wrote:
> On 2014-06-07, Todd <Todd@invalid.invalid> wrote:
*SKIP*
>> Obviously
>> echo "${x}Status"
> Bash evaluates ${x} as abc and tacks it onto Status, so that this
> command gives you anoutput of abcStatus. It does not give you the
> contents of abcStatus. How you do a second layer substitution I do
> not know. Certainly echo ${${x}Status} does not work either.
Yeah, baby, I did it!
{11:1} [0:0]% foo=bar
{1663:2} [0:0]% eval ${foo}quux=baz
{2096:17} [0:0]% echo $(eval $(echo echo \$${foo}quux))
baz
Note: using backticks (either outside or inside) breaks to:
{2110:18} [0:0]% echo `eval $(echo echo \$${foo}quux)`
14562{foo}quux
Second, it's zsh; that might matter.
*CUT*
--
Torvalds' goal for Linux is very simple: World Domination
Stallman's goal for GNU is even simpler: Freedom
Back to comp.os.linux.misc | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
need bash indirect variable help Todd <Todd@invalid.invalid> - 2014-06-07 11:49 -0700
Re: need bash indirect variable help William Unruh <unruh@invalid.ca> - 2014-06-07 23:42 +0000
Re: need bash indirect variable help Eric Pozharski <whynot@pozharski.name> - 2014-06-08 12:19 +0300
Re: need bash indirect variable help Eric Pozharski <whynot@pozharski.name> - 2014-06-09 15:07 +0300
Re: need bash indirect variable help Richard Kettlewell <rjk@greenend.org.uk> - 2014-06-08 09:03 +0100
Re: need bash indirect variable help Todd <Todd@invalid.invalid> - 2014-06-08 02:35 -0700
Re: need bash indirect variable help Huibert Bol <huibert.bol@quicknet.nl> - 2014-06-08 10:29 +0200
Re: need bash indirect variable help Todd <Todd@invalid.invalid> - 2014-06-08 02:36 -0700
Re: need bash indirect variable help Jerry Peters <jerry@example.invalid> - 2014-06-08 20:31 +0000
Re: need bash indirect variable help Todd <Todd@invalid.invalid> - 2014-06-08 14:53 -0700
Re: need bash indirect variable help floyd@apaflo.com (Floyd L. Davidson) - 2014-06-08 14:50 -0800
Re: need bash indirect variable help Jerry Peters <jerry@example.invalid> - 2014-06-09 20:44 +0000
csiph-web