Test content
cat test-sed.txt
aaa/bbb/ccc/ddd/eee
fff/ggg/ss
replace "ccc/ddd" to "CCC/DDD" via sed
NEW_STRING="CCC/DDD"
sed -i "s:ccc/ddd:${NEW_STRING}:" test-sed.txt
Notes:
- use ':' as seperate char rather than '/', which is default
- use "" include the replace command
No comments:
Post a Comment