shell (2) 时间处理
生活随笔
收集整理的這篇文章主要介紹了
shell (2) 时间处理
小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.
獲取當(dāng)前的時間,并輸出
#!/bin/bash if [ $# -ne 1 ];thenecho "input an dmesg time"exit 1 fi unix_time=`echo "$(date +%s) - $(cat /proc/uptime | cut -f 1 -d' ') + ${1}" | bc` echo ${unix_time} date -d "@${unix_time}" '+%Y-%m-%d %H:%M:%S'轉(zhuǎn)載于:https://www.cnblogs.com/linengier/p/10033341.html
總結(jié)
以上是生活随笔為你收集整理的shell (2) 时间处理的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: python中zip( )的使用
- 下一篇: java的集合:List、Set和Map