Help to replace a pattern with sed or awk
I am trying to find the best way to replace a pattern in the below 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
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?