Skip to content

Instantly share code, notes, and snippets.

@piyusht007
Created May 17, 2021 06:27
Show Gist options
  • Save piyusht007/96fcfa5bb2ee4d339c409465956d68f0 to your computer and use it in GitHub Desktop.
Save piyusht007/96fcfa5bb2ee4d339c409465956d68f0 to your computer and use it in GitHub Desktop.
Shell scripting cheatsheet
Date arithematic in Shell:
# Assign a specific date to variable
start=`date -d 2021-03-22`
# Add 1 day to the start
date -d "$start 1 days" # 2021-04-01
# Subtract 1 day from the start
date -d "$start -1 days" # 2021-03-29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment