cat script4
Code:
/Owner/{
N
s/ *\n/ /
s/Owner and Operator Guide */Installation Guide\
/
}
cat operator2
Code:
Consult Section 3.1 in the Owner and Operator
Guide for a description of the tape drives
available on your system.
Look in the Owner and Operator Guide shipped with your system.
Two manuals are provided including the Owner and
Operator Guide and the User Guide.
The Owner and Operator Guide is shipped with your system.
According to this
http://docstore.mik.ua/orelly/unix/sedawk/ch06_01.htm ("Do you see the two problems? The most obvious problem is that the last line did not print."), the last line shouldn't have been printed, because N cannot be applied to the last line (which contains the string "Owner"), and yet if I run
sed -f script4 operator2, the last line is printed, even if the substitution (to "Installation Guide") isn't made.
Any ideas why this is happening?