title: Line continuation in an extended string in a bash script
body: <p>Is it possible to do something like:</p>
  
  <pre><code>a="one"
  b="two"
  c="three"
  
  str="
  first=$a\n
  second=$b\n
  third=$c\n
  "
  printf $str
  </code></pre>
  
  <p>I've tried doing:</p>
  
  <pre><code>str=" \
  first=$a\n \
  second=$b\n \
  third=$c\n \
  "
  </code></pre>
  
  <p><strong>Update:</strong> here is a series of attampts. The goal is to just be able to create a string on multiple lines. For instance, can be done in javascript and python.</p>
  
  <p>lintest.sh</p>
  
  <pre><code>str1="
  first line \n
  second line \n
  "
  
  str2="
  first line \n \
  second line \n \
  "
  
  str3="
  first line \
  second line \
  "
  
  str4="
  first line
  second line
  "
  
  str5='first line\nsecond line\n'
  
  a="first line"
  b="second line"
  str6="%s\n%s\n"
  
  printf $str1
  printf "\n"
  printf $str2
  printf "\n"
  printf $str3
  printf "\n"
  printf $str4
  printf "\n"
  printf $str5
  printf "\n"
  printf $str6 \
  "$a" \
  "$b"
  </code></pre>
  
  <p>output:</p>
  
  <pre><code>balter@exalab3:~/lbalter$ bash lintest.sh
  first
  first
  first
  first
  first
  first line
  second line
  </code></pre>