|
藍森林 http://www.lslnet.com 2006年8月08日 13:08
如何用shell取昨天的日期?
如何用shell取昨天的日期? |
如何用shell取昨天的日期?
myyear=`date|cut -c 25-28`
mymonth=`date +%D| cut -c 1-2`
myday=`date +%D|cut -c 4-5`
update=$myyear$mymonth$myday
echo `expr $update - 1 ` |
如何用shell取昨天的日期?
:roll: 那1日的昨天豈非是0日? |
如何用shell取昨天的日期?
沒有考慮到這個細節。 |
如何用shell取昨天的日期?
參考shell版的這篇文章:
http://www.www.lslnet.com/linux/jh/24/9178.html |
| |