My only suggestion would be to take the dataset, strip trailing slashes, and then sort it. The sorted data will appear in the same order as an html folder hierarchy, and printing it out should be fairly easy. | [reply] |
It's kind of unweildy, but it can be done as a "one liner". Assumes the list of paths are in junk.dat:
perl -MList::Util=reduce
-nle"$p{reduce{$p{$a}=1;$a=qq[$a/$::b]}split'/'}=1}{print for sort key
+s%p"
junk.dat
/admin
/admin/test
/core
/core/system
/core/system/init.conf
/demo
/demo/test
/demo/test/core
/demo/test/core/newfile.cgi
/demo/test/file1234.cgi
Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.
| [reply] [d/l] |
| [reply] |
You really need to show us the sort of output you want. You don't make it clear whether you want a list of filenames, or you want a fancy ASCII-art tree, for example. Second, you need to show us what you've tried so far, and explain how its output differs from what you expect and from what you want. Only then can we help you. | [reply] |