cpu=$1
mem=$2
if [ $cpu == 4 ];then
vcores=4
if [ "$mem" == "15G" ];then
mb=12288
elif [ "$mem" == "7.3G" ];then
mb=6200
fi
elif [ $cpu == 8 ];then
vcores=8
if [ "$mem" == "15G" ];then
mb=12288
elif [ "$mem" == "7.3G" ];then
mb=6200
fi
fi
#把2.txt的第三行中的a替换成b。
sed -i '3y/a/b/' 2.txt
标签:多重,elif,shell,mb,mem,案例,fi,cpu
From: https://www.cnblogs.com/anslinux/p/17154416.html