Shell Script for the #100DaysToOffload Challenge
September 6, 2023
#100DaysToOffload
#Script
I am getting quite close to my 1-year mark since I started the #100DaysToOffload challenge. Some quick mafs tell me that I can’t skip that many days if I want to make it to 100 blog posts by the end of the 365 days.
I wrote a script that takes the date when I made my first #100DaysToOffload blog post and the number of blog posts I have written through for challenge so far. The script then calculates some numbers to… motivate.
Here’s the script:
|
|
Some interesting things that I learned while preparing this script include:
- The use of
date -d
to work on a specific date. For exampledate -d 2023-09-03 +%s
will print the given date as seconds since epoch. - The use of
expr
for some of the maths. - The use of
bc
for floating-point maths (whichexpr
doesn’t support). - The use of
tput
to get the right sequences for formatting texts (that is how we are making some of the output text bold).
This post is 35th of my #100DaysToOffload challenge. Want to get involved? Find out more at 100daystooffload.com.
comments powered by Disqus
Similar Blog Posts
December 5, 2022
#100DaysToOffload
#CalVer
#Git
+2
September 3, 2023
#100DaysToOffload
#Milestone