News for hackers. Stuff that matters.
Re:Sherver: Bash lightweight web server by rascul on Wednesday December 22, 2021 @08:06AM (#29648768)
I believe the pure bash way of assigning a multi line string to a variable, without dealing with quoting, might be as follows:

    IFS='' read -r -d '' HEAD_TEMPLATE <<'EOF'
        <title>Sherver example</title>
        <meta name="description" content="Sherver example">
    EOF
https://stackoverflow.com/questions/1167746/how-to-assign-a-...
Re:Sherver: Bash lightweight web server by throwaway984393 on Wednesday December 22, 2021 @08:31PM (#29657689)
I mean, if it's got no single quotes:

  HEAD_TEMPLATE='
  <title>Sherver example</title>
  <meta name="description" content="Sherver example">
  '
Re:Sherver: Bash lightweight web server by rascul on Thursday December 23, 2021 @07:10AM (#29661063)
Yes this is indeed simpler, however I noticed in some of the code single quotes were also used [0] so I wanted to use an example that would work for that.

[0] https://github.com/remileduc/sherver/blob/master/scripts/ind...