Question
In linux, you have file, test.txt, how do you insert "hello there" before every line that has the string "test" in it (where the new output is sent only to stdout, i.e. the file itself is not changed)?
sed -e '/test/i \
hello there' test.txt
^^ note the /regex/i syntx, the \ line seperator and all else:)

Question
In linux, you have file, test.txt, how do you insert "hello there" before every line that has the string "test" in it (where the new output is sent only to stdout, i.e. the file itself is not changed)?
?

Question
In linux, you have file, test.txt, how do you insert "hello there" before every line that has the string "test" in it (where the new output is sent only to stdout, i.e. the file itself is not changed)?
sed -e '/test/i \
hello there' test.txt
^^ note the /regex/i syntx, the \ line seperator and all else:)
If you want to change selection, open document below and click on "Move attachment"

8. Streams and sed -- The Stream Editor
rting from a line matching the regular expression Dear Henry up to a line matching Love Jane (or the end of the file if one does not exist). This behavior applies just as well to to insertions: <span>sed -e '/Love Jane/i\ Love Carol\ Love Beth' Note that the $symbol indicates the last line: sed -e '$i\ The new second last line\ The new last line.' and finally, the negation symbol, ! , is used to match

#### Summary

status measured difficulty not learned 37% [default] 0

No repetitions