how to add line before last 2 lines
It's a script that ads a line at a specific line number
This file is changed almost every day except the last 2 lines.
I need a way to add a line always before the last two lines
This is my script...But this one ads a new line at linenumber 400.
read a b c
sed -i "400i\ 2 rate $a$k src $b # $c" eth0.cfg
sed -i "400i\ 2 rate $a$k dst $b # $c" eth1.cfg