80I am trying to read a file and replace a placeholder with the content of another file. The problem is the variable contains urls which seems to cause problems in sed. In addition: what to do to keep the new lines from images.txt? Is there a way to make my solution work or is there maybe another solution that is better suited for my problem? I want to overwrite content of a file with the content of a backup file. In addition the step should include replacing a placeholder with the content of a third file. Thank you. What I currently use:
<images.html
TEXT=$(<images.txt)
sed 's~URLS~$TEXT~g' imagesbu.html > images.html
This does not work and just shows:
sed: -e expression #1, char 80: unknown option to `s'
Content of the file is:
https://cdn.tutsplus.com/vector/uploads/legacy/tuts/165_Shiny_Dice/27.jpg
https://cdn.tutsplus.com/vector/uploads/legacy/tuts/165_Shiny_Dice/27.jpg
IF there is no newline in the file it works.