[PLUG] tree to html

Kyle Accardi sandbox at pacifier.com
Fri Dec 13 03:51:21 UTC 2002


Jeme A Brelin wrote:
 >>I wrote:
>>First approach used `find` and if the filename wasn't a directory, I
>>echoed a few &nbsp's to indent it.  But when your directory has more
>>than two levels, that approach falls appart and you are looking at
>>keeping track of how deeply you are nested so you can output the
>>proper indentation.  Gnarly stack ops in bash dude.  Some other day.
> 
> 
> It seems like you could just use `find .` and check to see if the current
> output string is a substring of the following output string and if so
> store it as $CURRENT_DIR and indent appropriately moving down the
> tree.  You could use sed to split on the / and see what comes out that
> way, too.

Maybe.  I'll have to think this through more.


> Did you try `tree -H`?  Was that just not what you needed?


My tree don't have no -H, what does yours do?


>>If I could substitute "|--" with "&nbsp", I'd be a little happier.
> 
> 
> It's called sed, sir.


Yes this occured to me, and I'm hitting my sed references at the moment. 
What's with the sir?  Is that snide for punk?

Cheers,
Kyle Accardi





More information about the PLUG mailing list