Variable's value in bash can be easily called with echo $var
command like this
user@linux:~$ a=1; b=2; c=a+b
user@linux:~$ echo $a $b $c
1 2 a+b
user@linux:~$
What I'm trying to accomplish is to replace x
with the actual value in a,b,c
user@linux:~$ a=1; b=2; c=a+b
user@linux:~$ for i in a b c; do echo "$i = x"; done
a = x
b = x
c = x
user@linux:~$
By using similar for
loop, I hope I can get an output like this
a = 1
b = 2
c = a+b