#!/bin/sh
# dtree.root
# 
# 2009(C) S.Ono
#
op=`pwd`
if [ $op = "/" ]
then
	find . -type d -perm +5 -print 2>/dev/null | grep -v \/proc |
	awk ' {
		FS="/"
		s=$0
		n=length(s)
		len=split(s,a)
	
		for(i=0;i < len;i++)
		{
			if(a[i] == "."  || i == 0)
			{
				printf("  ",len)
				continue
			}
			printf("| ",len)
		}
		printf("+%s",a[i])
		printf("\n");
	}'
fi

