sed addresses

Vu Pham vu at sivell.com
Wed Jan 6 10:52:21 PST 2010


I am trying to use the syntax 1,addr2 in sed as follows:

-e "1,/^create/ s/ xxx/ yyy/g"

My purpose is to replace all the words "xxx" with the words "yyy" from 
line 1 to the line that starts with "create".

It just does not work. IT works when I replace addr2 ( /^create/ ) with 
some number like 10. But the fact is the addr2 varies.

Thanks for your advice,

Vu


More information about the Linux-users mailing list