sh 版本:1.14.7
#!/bin/sh
cpu_to_eth1=10
cpu_to_eth2=20
cpu_to_eth3=30
cpu_to_eth4=40
i=0
for i in 1 2 3 4
do
echo "value of the $i th varible is $cpu_to_eth$i"
done
它工作不正常,输出应该是
value of the 1 th varible is 10
value of the 2 th varible is 20
value of the 3 th varible is 30
value of the 4 th varible is 40