title: Passing a string with spaces as a function argument in Bash
body: <p>I'm writing a Bash script where I need to pass a string containing spaces to a function in my Bash script.</p>
  <p>For example:</p>
  <pre><code>#!/bin/bash
  
  myFunction
  {
      echo $1
      echo $2
      echo $3
  }
  
  myFunction &quot;firstString&quot; &quot;second string with spaces&quot; &quot;thirdString&quot;
  </code></pre>
  <p>When run, the output I'd expect is:</p>
  <pre><code>firstString
  second string with spaces
  thirdString
  </code></pre>
  <p>However, what's actually output is:</p>
  <pre><code>firstString
  second
  string
  </code></pre>
  <p>Is there a way to pass a string with spaces as a single argument to a function in Bash?</p>