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 |
what is the use of the hidden files?
Write a command to find all of the files which have been accessed within the last 30 days.
Explain how to use grep command to list find the records of a file containing 10 different strings?
What is the difference between Shell Programming and Shell scripting?
10 Answers HCL, TCS, Wipro,
what are wild cards?
How would you change all occurrences of a value using VI?
what do you understand by 'unix is a portable os'?
How to remove a crontab file?
What command is used to check the current users?
When i run a programm of orphan process. Instead of getting child's parent (ppid)=1 ..i get 1400 and it varies as per system. How can i findthe right soluion??? My pgm: #include<stdlib.h> # include <stdio.h> int main() { int pid; pid=fork(); if(pid < 0) {exit(-1);} else if(pid==0) { printf("Child Process is Sleeping ..."); sleep(10); printf("Orphan Child's Parent ID : %u ",getppid()); } else { printf("Parent Process Completed ... %u ",getpid()); exit(0); } return 0; } Output:
What is clustering in HP and how it's work?
what is ls -ltd?