The UNIX and Linux Forums  


Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
.
google unix.com




View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #6 (permalink)  
Old 03-09-2008
Perderabo's Avatar
Perderabo Perderabo is offline Forum Staff  
Unix Daemon
  
 

Join Date: Aug 2001
Location: Ashburn, Virginia
Posts: 9,131
Quote:
Originally Posted by grebbux View Post
I think I'm getting somewhere, when I try this:


Code:
echo $DirectoryListing | sed 's/ /<br>/' >> $HTMLFILE

So I have one <br> after the first listing. I don't understand why the break isn't substituted for all the other spaces though!
That sed s command only replaces the first match. You need the g flag to do them all.


Code:
echo $DirectoryListing | sed 's/ /<br>/g' >> $HTMLFILE

But I'm glad you got it solved.