Hello all,
I find it hard to explain what I need so I will post the code
OVZINCLUDE="16810 16811 1689"
PLUS_16810="test"
PLUS_16811="test"
for VPS in $OVZINCLUDE
do
echo "Dumping VPSes: $OVZINCLUDE "
vzdump --compress --snapshot ${PLUS_$VPS} $VPS
done
The idea is when for parses 16810 to use PLUS_16810 as vzdump argument, same for 16811 and etc.
The code above gives bad substitution error.
I know I can use eval for the naming of the variable as something_$VARIABLE, but how to use it in reverse?
p.s. That is in
bash --version
GNU bash, version 4.1.5(1)-release (x86_64-pc-linux-gnu)