1

Currently having a problem with using SED command

For example: I have 2 files

First file contain abc Second file contain abcaaa

Sed command i am using

sed -i "s/'abc'/change/g"

However my result for both file turn out to be

first file : change second file changeaaa

How do i make it only equal to abc and not contain abc?

Raian Sze
  • 25
  • 4
  • 1
    See: [The Stack Overflow Regular Expressions FAQ](http://stackoverflow.com/a/22944075/3776858) – Cyrus Jun 03 '17 at 08:24

1 Answers1

0

with GNU sed:

sed -r 's/\babc\b/change/g' file
tso
  • 4,732
  • 2
  • 22
  • 32