如果那么如何使用多个

时间:2013-04-15 08:37:59

标签: linux scripting

如果使用multipal if if elif,否则,当脚本运行时,应该询问您要下载哪个版本。用户将输入所需的版本,然后下一个命令将根据参数。

echo "n Latrest version"

echo "p Previous version N-1"

echo -n "Which version you want to BackUP [n or p]? "

read Ver

if [ $Ver = n ]; then

echo `$n`

if [ $Ver = per ]; then

echo `$p`

echo "Coping BackUP File"

fi

fi

1 个答案:

答案 0 :(得分:1)

If [ conditional expression1 ]
then
statement1
statement2
.
elif [ conditional expression2 ]
then
statement3
statement4
.
.
.
else
statement5
fi