| Newsgroups |
gmane.editors.sed.user |
| Message-ID |
<[email protected]> |
Concerning q (lower), the GNU sed manual says: Exit sed without processing any more commands or input. Note that the current pattern space is printed if auto-print is not disabled with the -n options.
Concerning Q (upper), it says: This command is the same as q, but will not print the contents of pattern space.
I don't write or edit the manual. But those definitions seemed adequate to me.
Anders Granlund, from Sweden, recently wrote me. Among other helpful comments, he pointed out that the qQ definitions and distinction between the two are incomplete, because they fail to take into account scheduled text (from arR commands). Here is a comparison that I think (hope) makes it clear:
$ echo y | sed -e ix -e az -e q
x
y
z
$ echo y | sed -e ix -e az -e Q
x
q prints scheduled text (in this case, from a). Q does not. So the documentation seems incorrect, or at least incomplete. I would suggest q might say something like "Note that the current pattern space is printed if auto-print is not disabled with the -n options. Also, scheduled text is printed." and Q "This command is the same as q, but will not print the contents of pattern space, nor any scheduled text." Is original definition better, expanded definition, or something else? Any other comments?
Also, it seems Q is the only way to suppress scheduled output (from arR). Is that correct?
Thanks,
Daniel