Do you want BuboFlash to help you learning these things? Or do you want to add or correct something? Click here to log in or create user.



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)?
Answer
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)?
Answer
?

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)?
Answer
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

statusnot learnedmeasured difficulty37% [default]last interval [days]               
repetition number in this series0memorised on               scheduled repetition               
scheduled repetition interval               last repetition or drill

Details

No repetitions


Discussion

Do you want to join discussion? Click here to log in or create user.