2 thoughts on “shell script to get yesterday’s date into a variable

  • February 1, 2014 at 7:09 am
    Permalink

    On Linux, you can use

    date -d “-1 days” +”%a %d/%m/%Y”

    Reply
  • February 1, 2014 at 7:58 am
    Permalink

    bdate=`date -d “-31 days” +”%Y%m%d”`
    echo “$bdate”

    Reply

Leave a Reply

Your email address will not be published. Required fields are marked *

%d bloggers like this: