Insert a line at specific line number with sed or awk
Solution 1:
sed -i '8i This is Line 8' FILE
inserts at line 8
This is Line 8
into file FILE
-i
does the modification directly to file FILE, no output to stdout, as mentioned in the comments by glenn jackman.
Solution 2:
An ed
answer
ed file << END
8i
Project_Name=sowstest
.
w
q
END
.
on its own line ends input mode; w
writes; q
quits. GNU ed has a wq
command to save and quit, but old ed's don't.
Further reading: https://gnu.org/software/ed/manual/ed_manual.html