maybe it will be useful when we want to find a variable in a directory.
target=$1
traversal(){
cd "$1"
for x in *
do
if [ -f $x ]
then
#echo $x
grep $target $x>null
if [ $? = 0 ]
then
echo $PWD/$x
fi
fi
if [ -d $x ]
then
traversal "$PWD/$x"
fi
done
}
traversal $PWD
use like this
./a.sh call