title: BASH shell script echo to output on same line
body: <p>I have a simple BASH shell script which checks the HTTP response code of a curl command.
  The logic is fine, but I am stuck on "simply" printing out the "output".  </p>
  
  <p>I am using GNU bash, version 3.2.25(1)-release (x86_64-redhat-linux-gnu)</p>
  
  <p>I would like to output the URL with a tab - then the 404|200|501|502 response.  For example:</p>
  
  <pre><code>http://www.google.co.uk&lt;tab&gt;200
  </code></pre>
  
  <p>I am also getting a strange error where the "http" part of a URL is being overwritten with the 200|404|501|502.  Is there a basic BASH shell scripting (feature) which I am not using?</p>
  
  <p>thanks</p>
  
  <p>Miles.</p>
  
  <pre><code>#!/bin/bash
  
  NAMES=`cat $1`
  for i in $NAMES
  do
  
      URL=$i
      statuscode=`curl -s -I -L $i |grep 'HTTP' | awk '{print $2}'`
  
      case $statuscode in
      200)
          echo -ne $URL\t$statuscode;;
      301)
          echo -ne "\t $statuscode";;
      302)
          echo -ne "\t $statuscode";;
      404)
          echo -ne "\t $statuscode";;
      esac
  done
  </code></pre>