Created
May 17, 2021 06:27
-
-
Save piyusht007/96fcfa5bb2ee4d339c409465956d68f0 to your computer and use it in GitHub Desktop.
Shell scripting cheatsheet
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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