linux-tutorial/codes/shell/示例脚本/逻辑控制/使用elif.sh

20 lines
340 B
Bash
Raw Normal View History

2019-05-10 11:17:57 +08:00
#!/bin/bash
# looking for a possible value
if [ $USER = "tiandi" ]
then
echo "Welcome $USER"
echo "Please enjoy your visit"
elif [ $USER = testing ]
then
echo "Welcome $USER"
echo "Please enjoy your visit"
elif [ $USER = barbar ]
then
echo "Do not forget to logout when you're done"
else
echo "Sorry, you are not allowed here"
fi