#!/bin/sh # Recurse.sh # Chieh Cheng # 2005-3-24 # GNU General Public License (GPL) Version 2, June 1991 scriptName=`echo $0 | sed s/\\\\/.*\\\\///g` if [ $# -lt 1 ] then echo " Usage: $scriptName \"command\"" else executable="$0" command="$*" $command for entry in * do if [ -d "$entry" ] then echo "Recursing into ${cwd}:" cd "$entry" cwd=`pwd` $executable "${command}" cd .. fi done fi