I\'m trying to insert text to the third line in a file using sed, and the syntax I\'ve found on other forums is:
sed -i \'\' \"3i\\ text to insert\" file
This works for me
sed -i '' '3i\ text to insert' file