
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! What a nuisance! 😭 ...
 or follow me on Twitter [@singhkays](https://twitter.com/singhkays)](https://singhkays.com/blog/arm-cpu-faster-than-apple-m1/media/theres-a-storm-coming-intel-amd-arm-dark-knight_hu_95498d22e313dc28.jpg)
 or follow me on Twitter [@singhkays](https://twitter.com/singhkays)](https://singhkays.com/blog/apple-silicon-m1-black-magic/media/apple_new-m1-chip-graphic_hu_d30b976a8e6962da.jpg)
](https://singhkays.com/blog/how-spotify-is-killing-the-open-podcast-ecosystem/media/small-cover-spotify-2_hu_66daa145a69e66b2.jpg)




