using N with sed on last line
cat script4
Code:
/Owner/{ Code:
Consult Section 3.1 in the Owner and Operator Any ideas why this is happening? |
A Unix sed and a Posix sed terminate without printing the last buffer.
GNU sed disagrees with it, and does print the last buffer (unless the default printing is suppressed with sed -n ...). You can change that with the --posix option: Code:
sed --posix -f script4 operator2 |
The info page for sed (which is quite a bit more informative than the manpage, BTW) has this to say about the "N" command:
'N'A very pedantic reading of that and the description of the execution cycle suggests that the printing of that final line can be attributed to the automatic action at the end of each processing cycle, and not, at least techically, the result of any further commands.Add a newline to the pattern space, then append the next line of input to the pattern space. If there is no more input then `sed' exits without processing any more commands. |
All times are GMT -5. The time now is 10:33 PM. |