title: Shell Script: How to trim spaces from a bash variable
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/369758/how-to-trim-whitespace-from-bash-variable">How to trim whitespace from bash variable?</a>  </p>
  </blockquote>
  
  
  
  <p>I have searched and attempted a number of solutions but nothing seems to work for me... </p>
  
  <p>I have a shell variable which is causing issues due to leading and trailing spaces. how can we get rid of all the spaces in a single line using shell script?</p>