title: How to pass variables in curl?
body: <p>The goal is to create an account at example.com. We need an <strong>alphanumeric name</strong>, which we got.</p>
  
  <p><strong>What we have:</strong></p>
  
  <pre><code>$name="egon111"
  $pw="notegon"
  
  curl -s -X POST -d 'username="'"$name"'"&amp;password="'"$pw"'"' https://example.com/create
  </code></pre>
  
  <p><strong>We need normally the following curl command:</strong></p>
  
  <pre><code>curl -s -X POST -d "username=egon111&amp;password=notegon" https://example.com/create
  </code></pre>
  
  <p>What's wrong with the syntax? In my opinion we currently send as name <code>$name</code> and as password <code>$pw</code> exactly, not the variable itself, which is totally wrong.
  We get the following error:</p>
  
  <pre><code>Select a username that is alphanumeric.
  </code></pre>
  
  <p>Greetz,
  Klara</p>
  
  <p><em>I am new at stackoverflow. Feel free to comment so that I can improve myself.</em></p>