#! /bin/bash # A recursive script # Adjust verbosity to taste function go () { for i in `ls -i $@`; do if [ ! -e "$i" ] then j=`find -inum $i | sed s$/./$/$` if [ -f "$j" ]; then echo Reading file $PWD/$j elif [ -d "$j" ]; then echo Reading directory $PWD/$j echo Entering directory $PWD/$j cd "$j" go echo "Leaving directory $PWD" cd .. fi fi done } go $@