[CentOS] awk global replacement only after keyword

Fri Mar 26 13:31:48 UTC 2010
m.roth at 5-cent.us <m.roth at 5-cent.us>

> Trying to avoid a perl script which wouldn't be hard, but I am looking
> for an awk one liner that does a replacement, but only after it sees a
> key word on some line.
>
> Anyone know of that's easy to do?

{if ( $0 ~ /<keyword>/) (sub(str, repl);} print $0;}

      mark