title: Store result of an operations in a variable in bash
body: <p>I have a command in bash that returns the locale of an IP address stored in variable <code>$line</code>. The command looks something like this:</p>
  
  <pre><code>geoiplookup -f GeoIP.dat "$line" &gt;&gt; resultFile
  </code></pre>
  
  <p>which will return a result such as "New York, NY".</p>
  
  <p>Now I want to concatenate  the Ip address to the result so it looks something like this:</p>
  
  <p>"215.216.217.218, New York, NY"</p>
  
  <p>So something like:</p>
  
  <pre><code>$line +", "+ (geoiplookup -f GeoIP.dat "$line") &gt;&gt;resultFile
  </code></pre>
  
  <p>Can anyone give me the correct syntax to do this?</p>