#! /bin/sh echo 'ex6 //scan directory under recursively and exceute commands on files//' case $# in 0) dir=. ;; 1) dir=$1 ;; esac echo .... scanning directory $dir cd $dir for i in * do if test -d $dir/$i then $0 $dir/$i else ls -l $i echo "type any command: \c" read command eval $command fi done