Issue with Sed Command

Hello ,

I am trying to replace a word :: complete to Failed .

work: complete

Sed command which i am using is given below ::

sed s/work: complete/Failed/g temp1.txt > temp2.txt (Sed command is grabled if i use the above .. because of space which is there between work: and complete. I dont want to replace other words which has Complete.

Because i dont want to mess up other word which is having complete.

Please help me on this issue .. thanks !!

You should probably put quotes arount it.

Also you are replacing two words (work: complete) with one word (Failed)

Try

sed "s/work: complete/work: failed/g" temp1.txt > temp2.txt

Subtle difference:

sed -e "s/work: complete/work: Failed/g" temp1.txt > temp2.txt

As "scottn" implies, please show exact examples of before and after text.

Forgetting the -e (it works fine without it), I purposely wrote "failed" in lower case. Why purposely replace a word with a lowercase first letter with one with an uppercase letter?!

awk '{gsub("work: complete","Failed")}1' file

Thanks Everyone!!

I just wanted to replace Failed which is associated with Machine .

Thanks!!

that is

[code]
:1,$s/work: complete/work: failed/g