[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: Sed programming question



Cameron Simpson wrote:
On 10Dec2008 18:39, Dan Thurman <dant cdkkt com> 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 it work as an "AND operator":

# echo "foo har" | sed -re '/foo/{/bar/{s/foo/goo/}}'
goo har



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]