#!/bin/sh # Recurse.sh # 2005-3-24 # Chieh Cheng # GNU General Public License (GPL) Version 2, June 1991 scriptName=`basename "$0"` if [ $# -lt 1 ] then echo " Usage: ${scriptName} \"command\"" else cwd=`pwd` 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