How to replace the exact word in vi editor??
suppose a file contains words like amaze,amazed,amazement in
some of the line.But i want to replace only 'amaze' with
delight but don't wanna replace amazed or amazement.
thanks
Answers were Sorted based on User's Feedback
Answer / shilpi gupta
sed 's/\<amaze\>/delight/g' file_name
or
In Vi editor..you can use
:%s/\<amaze\>/delight/g
| Is This Answer Correct ? | 7 Yes | 0 No |
Answer / kranthi kumar
:1,$s/amaze$/amazing/g
this will be changed only amaze in totalvi editor....
| Is This Answer Correct ? | 2 Yes | 3 No |
Is grep faster than awk?
How do you create a file in UNIX
36 Answers Accenture, EMG, Nokia, QA, TD,
How do you create a directory in UNIX?
How do you remove a crontab file?
How to delete a directory containing files and folders?
Give a regular expression that finds two things, try to come up with regular expressions that find each individually using "egrep" command?
What is s and g in sed command?
How many unix commands are there?
How to check the flavor of UNIX?
use of ls command
what is the functionality of kernel in unix architecture?
how to find the 51th record of a file containing 100 records in unix.