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, what does the below code do?
sed -e '7a\
an extra line' test.txt
Answer
It adds the line "an extra line" after line 7 of test.txt, but note that this output is only sent to stdout, the file itself is not changed!!!

Question
In linux, what does the below code do?
sed -e '7a\
an extra line' test.txt
Answer
?

Question
In linux, what does the below code do?
sed -e '7a\
an extra line' test.txt
Answer
It adds the line "an extra line" after line 7 of test.txt, but note that this output is only sent to stdout, the file itself is not changed!!!
If you want to change selection, open document below and click on "Move attachment"

8. Streams and sed -- The Stream Editor
perations that make it easy to write scripts that edit configuration files for you. For instance, sed -e '7a\ an extra line.\ another one.\ one more.' a ppends three lines after line 7, whereas <span>sed -e '7i\ an extra line.\ another one.\ one more.' i nserts three lines before line 7. Then sed -e '3,5D' D eletes lines 3 through 5. In sed terminology, the numbers here are called addresses, which can also be regular expressions 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.