0
votes

When i try create new variable with value in the another variables name in bash, I'm failing

]$ xxx=xxx
]$ echo $xxx
xxx

but when i try this:
]$ yyy_${xxx}=yyy
-bash: yyy_xxx=yyy: command not found

or

]$ yyy_$(${xxx})=yyy
-bash: xxx: command not found

or

]$ yyy_$(echo ${xxx})=yyy
-bash: yyy_xxx=yyy: command not found

Please tell me how can I solve this issue? Thanks!

1

1 Answers

0
votes

The issue was resolved:

declare yyy_$(echo ${xxx})=yyy

or

declare yyy_$(${xxx})=yyy

it works!