• aidan@lemmy.worldOP
    link
    fedilink
    arrow-up
    0
    ·
    4 months ago

    I’m reading this and interpreting that line 27 of that script is

    And your interpretation is wrong. Line 27 is actuallly

    sudo echo "${server_service}" > /lib/systemd/system/server.service

    ${server_service} is read from the file I posted in the 2nd image. Since it was a test script I hadn’t bothered implementing any escaping tools, I wanted to make sure terraform allowed this first.

    • listless@lemmy.cringecollective.io
      link
      fedilink
      arrow-up
      0
      arrow-down
      1
      ·
      edit-2
      4 months ago

      And there’s your problem. You’re echoing using double quotes which will interpret characters. Don’t do that. That’s a bug. cat or cp the file to the destination; printf if the contents are all in that variable.