title: curl command in git-bash
body: <p>I have a script written in bash and tested working in Linux (CentOS 7) and on MacOS. The script uses <code>cURL</code> to interact with a REST API compliant data platform (XNAT).</p>
  
  <p>I was hoping that Windows users could use the same script within git-bash that comes packaged with <em>Git for Windows</em>. Unfortunately there seems to be an issue when using <code>cURL</code> in git-bash.</p>
  
  <p>The first use I make of <code>cURL</code> is to retrieve a JSESSION cookie:</p>
  
  <pre><code>COOKIE=`curl -k -u $USERNAME https://theaddress/JSESSION`
  </code></pre>
  
  <p>On Linux, this asks the user for password and stores the cookie in <code>COOKIE</code>.
  In git-bash, issuing the command hangs, until using a "<code>ctrl + C</code>" to interrupt it. Strangely at that point the query message for the password is displayed, but too late, the script has terminated.</p>
  
  <p>I have a suspicion that this may have to do with <code>CR</code> or <code>LF</code> issues, but cannot find some info I understand regarding this.</p>
  
  <p>Any pointers would be welcome !</p>
  
  <p>Thank you</p>
  
  <p><strong>EDIT:</strong>
  It appears the above command works fine if I pass the password in the command like this:</p>
  
  <pre><code>COOKIE=`curl -k -u $USERNAME:$PASSWORD https://theaddress/JSESSION`
  </code></pre>
  
  <p>However, as pointed here:
  <a href="https://stackoverflow.com/questions/2594880/using-curl-with-a-username-and-password">Using cURL with a username and password?</a>
  I would rather avoid having the user typing their password as a command argument.</p>
  
  <p>So the question is now "why is <code>cURL</code> not prompting for a password when I use the first command?" when in git-bash on Windows, while that command behaves as expected in Linux or MacOS:</p>
  
  <pre><code> COOKIE=`curl -k -u $USERNAME https://theaddress/JSESSION`
  </code></pre>