title: Unable to POST a request to a server using CURL in BASH
body: <p>I have been trying to run a BASH script which posts a request to an SMS server and on successful execution a message is received on the mentioned mobile number. Script is as shown below:</p>
  
  <pre><code>curl -k -X POST "http://192.168.10.3/u=admin&amp;h=452ba065ebd1723598a51c7eca11d362&amp;op=pv&amp;to=1234567891&amp;msg=Hello+to+all"
  </code></pre>
  
  <p>The above script is working fine. The message "Hello to all" is being received on the mobile number 1234567891. This number is however hard coded in the URL. In the actual scenario the mobile number would be available in a variable and the SMS would be sent to the mobile number available in this variable.</p>
  
  <p>I have tried scripts like:</p>
  
  <pre><code>mobile_number="1234567891"
  curl -k -X POST "http://192.168.10.3/u=admin&amp;h=452ba065ebd1723598a51c7eca11d362&amp;op=pv&amp;to=$mobile_number&amp;msg=Message+From+world"
  </code></pre>
  
  <p>and</p>
  
  <pre><code>x="http://192.168.10.3/u=admin&amp;h=452ba065ebd1723598a51c7eca11d362&amp;op=pv&amp;to="
  x+="1234567891
  x+=&amp;msg=Hello+to+all"
  curl -k -X POST $x
  </code></pre>
  
  <p>However, i have been unsuccessful in executing them successfully. It would be of great help if someone could help me with the syntax. </p>