On 2010-08-02, Zhang Weiwu <zhangweiwu@realss.com> wrote: > > however, it does not match the following: > > select * from mytable where id=1 > and name='foo'"; > How about sed -n '{/id=1/N;/name=.foo/p;d;}'