⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 check.sh

📁 使用linux实现考勤功能
💻 SH
字号:
#!/bin/shecho "**********    WORK  ATTENDANCE  REGISTER    **********"#Input the username & passwordecho "Please input your name:"read nameecho "Please input the password:"read passwordinputinfo="$name $password"#grep "$inputinfo" userinfo.dat | wc -l#Match userinfogrep "$inputinfo" userinfo.datif [ $? -eq 0 ]then    echo " \07\07 Successfully log in..."else    echo "Invalid name or password! Please input again."    exit 1fi#Option Menu displayuntilecho "**********    WORK  ATTENDANCE  REGISTER    **********          1. Check in          2. Check out          3. Work Attendance Record          4. Exit          Welcome to the Work Attendance Registering System!          Please input your option and hit <Enter>:"read optiontest "$choice" = 4docase "$option" in         1) if [ "$hour" -lt 8 ]; then                 echo "Morning! Welcome to the office!"             else                  echo "You're late for work, a bit earlier next time."                 echo "Tardiness  $name `date` " >> check.dat             fi              ;;         2) if ["$hour" -gt ` expr 18 `]; then                  echo "Have a Nice Ride Home!"             else                  echo "You're early to leave. Any urgency?"                  echo "Early Departure" "$name `date` " >> check.dat              fi              ;;          3) grep "$name*"  check.dat  > search.dat               cat search.dat              ;;          4) echo "Thanks for using the system! Goodbye!"               exit 1               ;;          *) echo "INVALID OPTION! Please input again!"           esacdone

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -