title: Unable to print the public ip in shell script
body: <p>Hi I am trying to print the public ip of the machine in a file using shell script. I am using the command</p>
  
  <pre><code>ip=${curl ipinfo.io/ip}
  </code></pre>
  
  <p>in my script file and it gives an error saying bad substitution. whereas this command works when i run it in command line.
  Is this the right way to get the ip through the script? </p>
  
  <p>Thanks in advance!!</p>