Help to replace a pattern with sed or awk
Hello,
I am trying to find the best way to replace a pattern in the below line: Original Line: ./begintraffic -i eth0 -R radius -c 1000 -w testreport.data -m live -I all After search & replacement it should look like ./begintraffic -i eth0 -R radius -c 1000 -w /home/test/run/testreport.data -m live -I all Please note: 1) there may be more than one whitespace character after "-w" and the option can be anywhere in the line. I am trying with awk, but I am unable to find the right expression to match the pattern.Can anyone please help to get the right pattern matching expression with either sed or awk to achieve this? /Ramesh |
Use the following command:
Quote:
|
Or to make it a little easier to read:
Code:
sed -r 's@(testreport.data)@/home/test/run/\1@' file |
All times are GMT -5. The time now is 10:10 PM. |