Score:0

sed command to replace start of a line with new line, but line includes " / caused sed output errors

cn flag

I'm trying to replace the following line:

<inet-address value="${bind.address:IP}"/>

with a different line but I keep running into issues. There are similar lines up until the point where {bind.address: is different. IP is replaced with a random IP, so I just need to replace the entire line with a new one below.

I want to replace the entire line above with:

   <inet-address value="${bind.address:127.0.0.1}"/>

The combinations of " and / are causing me some issues and getting errors on output like:

sed: -e expression #1, char X: unknown option to `s'

Thank

hr flag
See [sed: -e expression #1, char 56: unknown option to `s'](https://askubuntu.com/questions/913688/sed-search-and-replace-with-variable-containing-slash) and the linked answer within
Artur Meinild avatar
vn flag
Does this answer your question? [sed search and replace with variable containing slash](https://askubuntu.com/questions/913688/sed-search-and-replace-with-variable-containing-slash)
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.