title: Looping through the elements of a path variable in Bash
body: <p>I want to loop through a path list that I have gotten from an <code>echo $VARIABLE</code> command.</p>
  
  <p>For example:</p>
  
  <p><code>echo $MANPATH</code> will return</p>
  
  <p><code>/usr/lib:/usr/sfw/lib:/usr/info</code></p>
  
  <p>So that is three different paths, each separated by a colon. I want to loop though each of those paths. Is there a way to do that? Thanks.</p>
  
  <p>Thanks for all the replies so far, it looks like I actually don't need a loop after all. I just need a way to take out the colon so I can run one <code>ls</code> command on those three paths.</p>