Skip to content

Instantly share code, notes, and snippets.

@shubhamagarwal92
Created July 10, 2019 18:45
Show Gist options
  • Save shubhamagarwal92/97bdb795b376b1a7a897c8be7a005719 to your computer and use it in GitHub Desktop.
Save shubhamagarwal92/97bdb795b376b1a7a897c8be7a005719 to your computer and use it in GitHub Desktop.
Get current date as variable in shell script
today="$(date '+%Y-%m-%d')"
yesterday="$(date -d yesterday '+%Y-%m-%d')"
echo $today
echo $yesterday
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment