In Linux, say one wants to add the following line before line number five (thus line nuber 5 becomes line number 6) and wants to have all the lines in the output numbered throught the sed 'tool' =
sed -n '5\Insert this line before line nuber 29' FILE
Question: Where does = go in this construction for numbering the whole output's lines?
I know nl and cat --number and such, but as seditself provides a built-in tool for this, it would be nice to work with just one toolbox.
Update: This is what the result should look like, in some way or another: Every line with a number and the line above squeezed in the place of line number five etc.
1 A line
2 Another line
3 as abovr
4 again
5 Insert this line before line nuber 29
6 This originally was line number 5
7 nearing the end
8 last line