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

16 lines
333 B
Bash

#!/bin/bash
#using the case command
case $USER in
tiandi | barbar)
echo "Welcome, $USER"
echo "Pleas enjoy your visit" ;;
testing)
echo "Special testing account" ;;
jessica)
echo "Do not forget to logout when you are out" ;;
*)
echo "Sorry, you are not allowed here" ;;
esac