That won't work, since there are no "<" ">" symbols in the input.
If one removes "\<" and "\>" from the sed command it will work as desired.
Btw. it looks like another useless use of cat
echo "this is test rrprdddddad prtestad yes this is test" | sed 's/pr[^ ]*ad/prahlad/g'
this is test rrprahlad prahlad yes this is test
I would prefer to add spaces , like below so only the "Words" starting and ending with the pr and ad will be modified
echo "this is test rrprdddddad prdsdjsnadjjdsn prtestad yes this is test" | sed -e 's/ pr[^ ]*ad$/ prahlad/g' -e 's/^pr[^ ]*ad /prahlad /g' -e 's/ pr[^ ]*ad / prahlad /g'
this is test rrprdddddad prdsdjsnadjjdsn prahlad yes this is test
All right, I launched DSL (damn small linux) as Qemu guest and run the GNU version of sed (v4.0) and it worked.
So next time I will check that before I report a non-working sed command :rolleyes: