我试图在运行用户定义次数的循环内声明、赋值和调用变量。我希望这些变量在循环后可用。我想做的是:
echo "HOW MANY ROUNDS OF TEST ITERATIONS WOULD YOU LIKE TO RUN?"
read round_nr
echo "Number of Iteration rounds set to: $round_nr!"
for r in $(seq 1 $round_nr); do
echo "HOW MANY COLD TEST ITERATIONS DO YOU WANT IN ROUND $r?"
read COLD$r
echo "HOW MANY WARM TEST ITERATIONS DO YOU WANT IN ROUND $r?"
read WARM$r
echo "HOW MANY HOT TEST ITERATIONS DO YOU WANT IN ROUND $r?"
read HOT$r
echo "HOW MANY NR OF FIXES PER TEST ITERATION $r?"
read NUMFIX$r
echo "ITERATION $r INPUT VALUES: COLD/WARM/HOT/NUMFIX:"
echo $COLD$r $WARM$r $HOT$r $NUMFIX$r
done
这样,对于每个循环(在用户定义的一组 round_nr 循环中),将创建四个变量并分配用户输入值。我计划稍后使用这些变量。
非常感谢您的帮助!