title: Variables overwriting text problem with "echo" in Bash
body: <p>I use OS X 10.6.5, Bash.</p>
  
  <p>When I run this:</p>
  
  <pre><code>echo $IP; echo of; echo $IPLINES
  </code></pre>
  
  <p>I get this output:</p>
  
  <pre><code>219.80.4.150:3128
  of
  1108
  </code></pre>
  
  <p>When I run this:</p>
  
  <pre><code>echo $IP of $IPLINES
  </code></pre>
  
  <p>I get this output:</p>
  
  <pre><code> of 1108.150:3128
  </code></pre>
  
  <p>I expected to get:</p>
  
  <pre><code>219.80.4.150:3128 of 1108
  </code></pre>
  
  <p>What would cause the distorted output I am getting?</p>
  
  <p>The actual script is this:</p>
  
  <pre><code>#!/bin/bash
  
  IPLINES=`cat a.txt | wc -l | awk '{print $1}'`
  
  if [ $IPLINES &gt; 1 ]; then
      LINE=`expr $RANDOM % $IPLINES + 1`
      IP=`head -$LINE a.txt | tail -1`
      sed -e "${LINE}d" -i .b a.txt
  
      echo $IP of $IPLINES
  fi
  </code></pre>