I'm trying to use this as my starting guide for using sed to add a line to a file in OSX. https://stackoverflow.com/questions/25631989/sed-insert-line-command-osx
sed -i '.json' '2i\ this is a test place ' dummy.txt
The above works. But I need to do expansion so I'm starting with something simple by just replacing with double quotes like
sed -i '.json' "2i\ this is a test place " dummy.txt
Why do I get
command i expects \ followed by text? Or how do I use double quotes on Mac to add text to a specific line?