r () { if [ -f "$1/lock" ]; then echo $1/lock fi; echo $1 for d in $(ls $1 -a) do if [[ $d!="." && $d!=".." ]]; then if [[ -d "$d" ]]; then echo "<<$d>>" ( r "$d" ) fi; fi; done}r .
r () { if [ -f "lock" ]; then echo `pwd`"/lock" fi; cd $1 for d in $(ls -a) do if [ $d != '.' ]; then if [ $d != '..' ]; then if [ -d "$d" ]; then ( r "$d" ) fi; fi; fi; done}r .
#!/bin/bashset -uer() { local DIR="$1" [ -d "$DIR" ] || return if [ -f "$DIR/lock" ] then echo "$DIR/lock" fi local DIRENTRY for DIRENTRY in "$DIR"/.* "$DIR"/* do case "$DIRENTRY" in .|..|*/.|*/..) continue ;; esac if [ -d "$DIRENTRY" ] then echo "<<$DIRENTRY>>" r "$DIRENTRY" else echo " $DIRENTRY" fi done}r "$@"