j4neiros
My digital hodgepodge
Wednesday, October 5, 2011
Previous date in bash
Sometimes I need the previous date in my scripts:
DATE=$(date +%Y%m%d --date=-1day)
For 10/5/2011 DATE = 20111004
$ date --version
date (GNU coreutils) 6.10
No comments:
Post a Comment
‹
›
Home
View web version
No comments:
Post a Comment