5

Need to pass value in sed command

view full story
linux-howto

http://www.unix.com – Hi, I have a file a.xml containing the below Code: <customerId>000</customerId> and a variable CUSTOMER_ID which is set to '333' Now I want to replace <customerId>000</customerId> with <customerId>333</customerId> by the below sed command and save the output in a file b.xml: Code: sed 's/<customerId>\([0-9]*\)/<customerId> ${CUSTOMER_ID}/' a.xml > b.xml But when I open b.xml after running the sed command, I see the below result : Code: <customerId> ${CUSTOMER_ID}</customerId> Please help. (HowTos)