Answers for "bash time loop"

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
-1

bash while loop n times

for (( i=0; i<10; ++i)); do
    [ -e filename ] && break
    sleep 10
done
Posted by: Guest on April-06-2021

Browse Popular Code Answers by Language