Re: Sed programming question

2008-12-12 Thread Kevin Martin
Dan Thurman wrote: Kevin Martin wrote: Gordon Messmer wrote: Dan Thurman wrote: I tested your suggestion above with and without -r option but could not make it work as an AND operator: # echo foo har | sed -re '/foo/{/bar/{s/foo/goo/}}' goo har $ rpm -q sed

Re: Sed programming question

2008-12-11 Thread Dan Thurman
Cameron Simpson wrote: On 10Dec2008 18:39, Dan Thurman [EMAIL PROTECTED] wrote: [snip!] You can only do AND by nesting multiple pattern matches: /foo/{ /bar/{ ... do stuff for foo AND bar } } I tested your suggestion above with and without -r option but could not make

Re: Sed programming question

2008-12-11 Thread Gordon Messmer
Dan Thurman wrote: I tested your suggestion above with and without -r option but could not make it work as an AND operator: # echo foo har | sed -re '/foo/{/bar/{s/foo/goo/}}' goo har $ rpm -q sed sed-4.1.5-11.fc10.x86_64 $ echo foo har | sed -re '/foo/{/bar/{s/foo/goo/}}' foo har --

Re: Sed programming question

2008-12-11 Thread Kevin Martin
Gordon Messmer wrote: Dan Thurman wrote: I tested your suggestion above with and without -r option but could not make it work as an AND operator: # echo foo har | sed -re '/foo/{/bar/{s/foo/goo/}}' goo har $ rpm -q sed sed-4.1.5-11.fc10.x86_64 $ echo foo har | sed -re

Re: Sed programming question

2008-12-11 Thread Dan Thurman
Gordon Messmer wrote: Dan Thurman wrote: I tested your suggestion above with and without -r option but could not make it work as an AND operator: # echo foo har | sed -re '/foo/{/bar/{s/foo/goo/}}' goo har $ rpm -q sed sed-4.1.5-11.fc10.x86_64 $ echo foo har | sed -re

Re: Sed programming question

2008-12-11 Thread Dan Thurman
Kevin Martin wrote: Gordon Messmer wrote: Dan Thurman wrote: I tested your suggestion above with and without -r option but could not make it work as an AND operator: # echo foo har | sed -re '/foo/{/bar/{s/foo/goo/}}' goo har $ rpm -q sed sed-4.1.5-11.fc10.x86_64 $ echo foo

Sed programming question

2008-12-10 Thread Dan Thurman
I think sed can handle relational operators, but I have not been able to figure it out. Am I correct in assuming that sed can use relational operators such as OR (|) or AND ()? Here is an example, but does not work: echo The | sed -e '/(the)|(THE)|(The)/i\ GOOD!' I tried looking up examples

Re: Sed programming question

2008-12-10 Thread Cameron Simpson
On 10Dec2008 18:39, Dan Thurman [EMAIL PROTECTED] wrote: I think sed can handle relational operators, but I have not been able to figure it out. Am I correct in assuming that sed can use relational operators such as OR (|) or AND ()? Here is an example, but does not work: echo The | sed -e

Re: Sed programming question

2008-12-10 Thread Dan Thurman
Cameron Simpson wrote: On 10Dec2008 18:39, Dan Thurman [EMAIL PROTECTED] wrote: I think sed can handle relational operators, but I have not been able to figure it out. Am I correct in assuming that sed can use relational operators such as OR (|) or AND ()? Here is an example, but does not

Re: Sed programming question

2008-12-10 Thread Dave Feustel
On Wed, Dec 10, 2008 at 07:01:24PM -0800, Dan Thurman wrote: Cameron Simpson wrote: On 10Dec2008 18:39, Dan Thurman [EMAIL PROTECTED] wrote: I think sed can handle relational operators, but I have not been able to figure it out. Am I correct in assuming that sed can use relational