How to insert a line into a file using sed
before a pattern and after a line number? And how to use the same in shell script?
This inserts a line before every line with the pattern :
sed '/Sysadmin/i \ Linux Scripting' filename.txt
And this changes this using line number range :
sed '1,$ s/A/a/'
So now how to use these both (which I couldn't) to insert a line into a file using sed
before a pattern and after a line number or another approach?