shell/结构化命令/使用elif.sh

20 lines
340 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