Hands-on task
This task is step 11 of the course “Dates and times in the terminal”
Count the number of days between dates
The file /root/range.txt contains two dates on two lines: the first is 2024-03-01, the second is 2024-06-01. Count by how many calendar days the second date is later than the first, and write the number to /root/days.txt. The sandbox's system time zone is Europe/Berlin, which has daylight saving time.
What you'll practise:
- date
- epoch
- date arithmetic
- bash arithmetic
- sed