#! /bin/bash

#
# Name		: ${HOME}/bin/tree.bash
#
# Version	: 1.0
#
# Author	: Gerard van Wageningen
#
# Description	: Program to list directory tree
#
# 1.0	First version
#


if [ $# -ne 1 ]
then

    echo "`pwd -P`"

fi

for i in .??* *
do

    if [ -h "${i}" ]
    then

	echo "${1}+ ${i}"

    else

	if [ -d "${i}" ]
	then

	    echo "${1}+--${i}"
	    cur_PWD="`pwd -P`"
	    'cd' "${i}" 1> /dev/null 2>&1
	    tree.bash "${1}|  "
	    'cd' "${cur_PWD}" 1> /dev/null 2>&1

	else

	    if [ -f "${i}" ]
	    then

		echo "${1}+ ${i}"

#	    else
#
#		echo "??? ${i} ???"
#

	    fi

	fi

    fi

done

exit 0


############# EOF #############
