Answers for "bash script for every date from now"

1

for loop on date in bash

d=2015-01-01
while [ "$d" != 2015-02-20 ]; do 
  echo $d
  d=$(date -I -d "$d + 1 day")

  # mac option for d decl (the +1d is equivalent to + 1 day)
  # d=$(date -j -v +1d -f "%Y-%m-%d" "2020-12-12" +%Y-%m-%d)
done
Posted by: Guest on July-22-2021
0

bash date

date	#displays date and time in terminal
Posted by: Guest on November-27-2020

Browse Popular Code Answers by Language