# file esplora GER DIR1 DIR2 cd $1 if test -d $2 -a -x $2 # $1 contiene un direttorio eseguibile ? then cd $2 # esiste un direttorio o file che si chiama $3? if test -d $3 -o -f $3 then echo `pwd` contiene $3 else echo trovato direttorio `pwd` mkdir $3 LISTA= # stringa vuota for i in * do if test -f $i -a -r $i then LISTA="$LISTA $i" fi done if test LISTA # se la lista non è vuota # then partec $3 $LISTA fi fi cd .. fi for i in * do if test -d $i -a -x $i then esplora $i $2 $3 fi done