I'm writing a Bash script and when inserting lines to a file using GNU sed, the first new line is inserted as a literal n, while the rest is inserted as new lines. The command is this:
sed '5i\n\n\n' myfile
The output is this:
As seen, the first line in the output contains an "n" where it should be none, what am I missing about this behavior? is it possible to make sed insert only new lines with '\n'? Thank you.