I have four variables, seen below:
p0="something"
p1="something"
p2="something"
p3="something"
p4="something"
var=()
I want to put each of the variables into an array with a loop, in a way so that I can call the value of the variable within the array. It should look something like this:
var=($p0 $p1 $p2 $p3 p$4)
I already tried this:
for i in {0..4}
do
$var[$i]="\$p$i"
done
but that doesn't work.