linux-tutorial/codes/shell/示例脚本/逻辑控制/使用elif.sh
2019-10-10 08:56:31 +08:00

20 lines
357 B
Bash

#!/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