Re: [SLUG] Text tree listing

From: Kevin Counts (counts@digicat.org)
Date: Mon Dec 01 2003 - 20:41:14 EST


Here is a Bourne/Bash function that does it.

Regards,

Kevin Counts

#------------------------------------------------------------------------
# tree(): Prints out tree format for a directory.
#-------------------------------------------------------------------------
tree()
{
    ( cd ${1-.}; pwd )

    find ${1-.} -print | sort -f | sed -e "s,^${1-.},," \
                                       -e "/^$/d" \
                                       -e "s,[^/]*/\([^/]*\)$,\ |-->\1," \
                                       -e "s,[^/]*/, | ,g";
}
-----------------------------------------------------------------------
This list is provided as an unmoderated internet service by Networked
Knowledge Systems (NKS). Views and opinions expressed in messages
posted are those of the author and do not necessarily reflect the
official policy or position of NKS or any of its employees.



This archive was generated by hypermail 2.1.3 : Fri Aug 01 2014 - 19:10:48 EDT