{
tab=$tab$singletab
line=${tab%"$singletab"}"|-------"
local count=$#
thisfile=${thisfile:-$PWD}/$file
if [ -d "$thisfile" ]; then
if [ $count -eq 1 ]; then
echo -e $line$file/
#echo -e "end!"
tab=${tab%"$singletab"}"\t"
redir $(ls $thisfile)
else
echo -e $line$file/
#echo -e "this is directory!"
redir $(ls $thisfile)
fi
else
echo -e $line$file
#echo -e "this is a file,you can do anything you want!"/
fi
thisfile=${thisfile%/*}
let count=count-1
done
tab=${tab%"|"}
line=${tab%"$singletab"}"|-------"
}
userinput="$@"
if ls $userinput; then
echo $file
echo '|'
if [ -d "$file" ]; then
cd $file
redir $(ls)
cd ..
fi
done
else
echo "$userinput is wrong"
fi