Fixing "sed: command i expects \ followed by text" error

I ran into a very weird error today. While trying to automate the deployment for this blog, I needed to replace a string in a file. The internet tutorials [1, 2, 3, 4] told me that sed would be perfect for this job and the following command should work: sed -i 's/search_string/replace_string/' filename The Error However, I kept getting tripped up by the following error: sed: 1: "i2.html": command i expects \ followed by text I spent a bunch of time trying to make sure I escaped the right characters in my strings but the error was persistent!...

December 10, 2020 · 2 min · Kay Singh

How do I discard unstaged changes in Git?

Often when I’m working on this blog, I work over multiple days and end up working on multiple devices. The blog is written in markdown and tracked in a Git repo on Azure Devops. The other day a scenario arose where I was customizing the theme of the blog but not getting anywhere. I decided to have another go at the customization few days later but this time on another device....

April 21, 2018 · 2 min · Kay Singh