-4

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

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
4

1 回答 1

1
If [ conditional expression1 ]
then
statement1
statement2
.
elif [ conditional expression2 ]
then
statement3
statement4
.
.
.
else
statement5
fi
于 2013-04-15T08:53:29.433 回答