[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Help-bash] Using PE to specify an array
From: |
Bruce Hohl |
Subject: |
[Help-bash] Using PE to specify an array |
Date: |
Fri, 14 Sep 2018 01:09:07 -0400 |
Hello List & thanks for any comments on this:
These commands work:
var1='ugly_hash'; declare -a _$var1; _ugly_hash+=(123);
But this does not:
_$var1+=(456); Error = "bash: syntax error near unexpected token `456'"
Question:
Is there a way to specify _ugly_hash using Parameter Expansion of $var1? In
the above I desired _$var1 to expand to _ugly_hash in order to add (+=) an
additional element to that array.
- [Help-bash] Using PE to specify an array,
Bruce Hohl <=
Re: [Help-bash] Using PE to specify an array, Greg Wooledge, 2018/09/14