Question
In linux, you have file called test.txt, how do you insert line "hello kevin" before line 7 of this file (note: do it so that the output will just be sent to stdout, i.e. the file itself will not be changed)
sed -e '7i \
hello kevin' test.txt

^^ note: the syntax of using 7i, to insert BEFORE line 7
^^ also note the use of '\' to break the line up properly, although following is totally correct too: sed -e '7i hello kevin' test.txt

Question
In linux, you have file called test.txt, how do you insert line "hello kevin" before line 7 of this file (note: do it so that the output will just be sent to stdout, i.e. the file itself will not be changed)
?

Question
In linux, you have file called test.txt, how do you insert line "hello kevin" before line 7 of this file (note: do it so that the output will just be sent to stdout, i.e. the file itself will not be changed)
sed -e '7i \
hello kevin' test.txt

^^ note: the syntax of using 7i, to insert BEFORE line 7
^^ also note the use of '\' to break the line up properly, although following is totally correct too: sed -e '7i hello kevin' test.txt

If you want to change selection, open document below and click on "Move attachment"

8. Streams and sed -- The Stream Editor
expression, so that it becomes 0 + .... 8.8 Inserting and Deleting Lines sed can perform a few operations that make it easy to write scripts that edit configuration files for you. For instance, <span>sed -e '7a\ an extra line.\ another one.\ one more.' a ppends three lines after line 7, whereas sed -e '7i\ an extra line.\ another one.\ one more.' i nserts three lines before line 7. Then sed -e

#### Summary

status measured difficulty not learned 37% [default] 0

No repetitions