Need to simplify a script that makes cool trees

Vivek Srivastav vsrivastav at gmail.com
Fri Dec 15 05:47:41 PST 2006


I may be responding a little late but just saw your post and no answers
posted. Maybe you have already sorted out your problem:

Here is a simple modification of your script. Put this function in
your .bashrc and use the tree command.

tree () 
{ 
    dirs=${@:-.};
    echo "Listing $dirs";
    for i in $dirs;
    do
        find $i -name \* | sed -e 's,^.$,,' \
		-e '/^$/d' \
		-e 's,[^/]*/\([^/]*\)$,+-----\1,' \
		-e 's,[^/]*/,|     ,g';
    done
}




More information about the freebsd-questions mailing list