Wednesday 15 October 2014

Get Yesterday's Date in Shell

#!/bin/bash
yest=$(date --date="yesterday" +"%Y/%m/%d")
echo "Yesterday's date: $yest"
now="$(date +'%Y/%m/%d')"
echo  "Today's date: $now"

No comments:

Post a Comment