DEV Community

Discussion on: Share Your Best Typo Story!

Collapse
 
habereder profile image
Raphael Habereder • Edited

I feel this so much, something similar happened to me a few days back.
When I tried to find out why our server grabbed and served old reports from our storage.

What I wanted: YearMonthDay-HourMinute, something like this: 200626-1030
Which I quickly slapped together via the linux's date tool

currDate=$(date +%y%m%d-%H%m)

After that innocent little line would be some sorting logic to determine the most recent report on our storage (s3 minio in this case), before it would be ultimately chosen and pumped into our report-serving container.

This one typo took me hours to find, I was so confused as to why it always grabbed the wrong reports. After a few hours my colleague noticed that the minutes were always the same. So after a quick look at the sorter, we saw that one incorrect lower case m

Wrong: currDate=$(date +%y%m%d-%H%m)
Right: currDate=$(date +%y%m%d-%H%M)

I screwed that one up, but was so happy someone else saw what I couldn't find.