#!/bin/bash
#set -P
function execdir()
{
echo Enterring $1
cd $1
#echo `pwd`
for s in $(ls -R `pwd`)
do
if [ -d $s ]
then
execdir $s;
elif [ $s = "run.sh" ]
then
#echo $s
nohup sh $s &
fi
done
echo Leaving `pwd`
cd ..
#echo `pwd`
}
curpwd=`pwd`
if [ $# -lt 2 ];then
echo Need to specify directory parameters.
exit
fi
for p in $*
do
str=$curpwd/$p
if [ -d $str ]
then
echo $str
execdir $str;
else
echo $curpwd/$p is not a directory.
fi
done