Get yesterday date
 

Get yesterday date


9fa02807da30edc179da9f0e7df6d075?s=80&d=wavatar&r=g
Posts: 77
Admin
Topic starter
(@mjv119gmail-com)
Member
Joined: 8 years ago

Hi All,
In my shell script, i need yesterdays date to be assigned to a varaible. Using below command command I able to get the todays date. Please help me to get yesterdays date in same formay.(DD-MMM-YYYY)

today_date=date '+%d-%h-%Y' | tr [] []
echo $today_date
Reply
1 Reply
9fa02807da30edc179da9f0e7df6d075?s=80&d=wavatar&r=g
Posts: 77
Admin
Topic starter
(@mjv119gmail-com)
Member
Joined: 8 years ago

This perfectly works for me in SunOS.

yesterday_date=TZ=EST+24 date +%d-%h-%Y | tr [] []

echo ${yesterday_date}

01-Aug-2019

Reply

Leave a reply

Author Name

Author Email

Title *

 
Preview 0 Revisions Saved
Share: