Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Message from discussion sed multiple -e pattern match problem
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Lem Novantotto  
View profile  
 More options Sep 17 2012, 10:29 am
Newsgroups: comp.unix.shell
From: Lem Novantotto <Le...@Hotmail.com>
Date: 17 Sep 2012 14:29:15 GMT
Local: Mon, Sep 17 2012 10:29 am
Subject: Re: sed multiple -e pattern match problem
pk ha scritto:

> "If no next line of input is available, the N command verb shall branch
> to the end of the script and quit without starting a new cycle or
> copying the pattern space to standard output."

This would have been relevant if we had run sed with "-n" option.
But we didn't.

See:

$ sed -n 'N;s/^def\nghi$/foo/;P;D' file # no good
abc
foo

$ sed -n '$!N;s/^def\nghi$/foo/;P;D' file # good
abc
foo
klm

$ sed 'N;s/^def\nghi$/foo/;P;D' file # good
abc
foo
klm

$ sed '$!N;s/^def\nghi$/foo/;P;D' file # good
abc
foo
klm
--
Bye, Lem
Ceterum censeo ISLAM esse delendum
_________________________________________________________________
Non sprecare i cicli idle della tua CPU, né quelli della tua GPU.
         http://www.worldcommunitygrid.org/index.jsp
http://www.rnaworld.de/rnaworld/  http://home.edges-grid.eu/home/
                    http://www.gpugrid.net/


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.