H
4

My friend the sysadmin showed me his old bash history and I felt dumb

So last week me and this guy I know from a local meetup were grabbing coffee and he pulled up his laptop to help me with a script I was stuck on. He typed like 3 commands and it worked. Then he casually showed me his bash history from like 10 years ago and every single entry was labeled with a comment like '# check if port is open' or '# rename all files here'. He said he started doing that after spending 2 hours trying to figure out what a one-liner did. I never thought to annotate my own commands. Now I'm going back through my old scripts and adding comments everywhere. Has anyone else had that moment where you realize you've been making things harder for yourself for no reason?
1 comments

Log in to join the discussion

Log In
1 Comment
uma_lopez
uma_lopez7d ago
That comment habit sounds like a solid move, I gotta admit. I once spent a whole afternoon trying to figure out why my own backup script kept deleting the wrong folder, turns out I had typed the path backwards and left zero notes for future me. Now I write little reminders like 'dont break this' on anything that took me more than ten minutes to get right, and future me is way less angry.
2