I have an HTML file in that I have a comment line as:
<!-- tag1 --><!-- tag11 -->
I need to insert a JQ
file element in between them.
I have tried and I was able to insert a small string but my string is large in size. Can anyone suggest me an idea?
i=0
code="(jq -r '.["$i"].code' file.json)";
eval v=\$$code;
sed -i 's/(<!-- tag1 -->)\(<!-- tag11 -->)/\1'$v'\2/' index.html;
It threw me an error as:
sed: -e expression #1, char 47: unterminated `s' command
However:
v="xxxxxxx"
sed -i 's/(<!-- tag1 -->)\(<!-- tag11 -->)/\1'$v'\2/' index.html;
The string is inserted perfectly can anyone help?
$v
contains a slash/
.