周末,学习的一天,学习linux shell,做个小笔记。

#!/bin/bash
time_start='09:00:00'
time1=$(date +%Y)'-'$(date +%m)'-'$(date +%d)" $time_start"
time2=$(date +%s -d "$time1")
while true
do
    time3=$(date +%s)
    time=$[$time3-$time2]
    tput setb $(($time % 8))
    echo "working"$[$time]"seconds"
    sleep 1
    if(($time > 32400)) 
    then
        echo "下班!bye~"
        init 0
        break
    fi
done

Linux shell 计算上班时间

Linux shell 计算上班时间

相关文章:

  • 2021-06-10
  • 2021-08-31
  • 2021-09-17
  • 2021-08-17
  • 2022-12-23
  • 2021-12-18
  • 2021-12-07
  • 2021-12-27
猜你喜欢
  • 2022-12-23
  • 2022-02-09
  • 2021-12-19
  • 2021-12-28
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案