Instead of:var1=foofoovar2=barbarvar3=jarjarIs there some trick I can to get the variable based on the order it was set in?var=foovar=barvar=jarecho $var2bar(I know the var variable is overwritten each time!)I'm seeking a trick since I constantly change the order of 20+ of these variables.It will be much easier if I just rearrange them by top-to-bottom order.
Bash variables - Any extract tricks based on the order?
bash;variable
Instead of using distinct variables, use an array:var=(      foo      bar      jar    )echo ${var[1]}   # bar