sed whole word search and replace

Posted by ksuralta on Stack Overflow See other posts from Stack Overflow or by ksuralta
Published on 2009-06-23T11:37:18Z Indexed on 2010/03/17 0:21 UTC
Read the original article Hit count: 768

Filed under:
|

Hi,

How do I search and replace whole words using sed? Doing sed -i 's/[oldtext]/[newtext]/g' will also replace partial matches of [oldtext] which I don't want it to do.

Thanks, Kenneth

© Stack Overflow or respective owner

Related posts about sed

Related posts about shell-scripting