What have I learned about sed?
Well, it's a stream editor, meaning it edits text that's fed through it.
When using sed to edit, you use regex filters and commands to make changes to the text.
I learned that sed applies it's entire program (filters and commands) to each line. So, it's important to be careful how you write these. If applied in the wrong order, you may over-edit the line you are editing.
I've learned that sed sends its output to the operating system's standard output stream. This means that you need to redirect this output to a file if you want to preserve the edits. It's a good idea to send the output to a temporary file first and then overwrite the original once you have confirmed correct edits.
No comments:
Post a Comment