Re: sed: dot does not match newline in multi-line mode (the M modifier) - bug or feature?

Paolo Bonzini <[email protected]>
Newsgroups gmane.editors.sed.user,gmane.comp.gnu.utils.bugs
Message-ID <[email protected]>
On 11/23/2011 11:15 AM, Dmitry Bolshakov wrote:
> Hi
>
> $ sed --version | head -n1
> GNU sed version 4.2.1
>
> test command:
>
> $ echo $'line1\nline2\nline3' | sed -n '1h;1!H;$bend;b; :end g;s/.*/dot
> matches newline/;p; g;s/.*/dot does not match newline/M;p'
> dot matches newline
> dot does not match newline
> line2
> line3
>
> I could not find anything about such behaviour in manual
> is this bug or feature?

It's a feature, but an undocumented one indeed.  Thanks for the report.

Paolo
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.