So, here is a little script that should do the trick, BUT:
1- I am not too familiar with the 'find' command, so bare with me. I am sure there is a simpler way to do this
2- be careful from where you start.
3- the command will be executed in the dir from where you start too. I don't know if this is a problem for you, but I couldn't do it otherwise...
Code:
#!/bin/bash
#===============================================================================
#
# FILE: recdir.sh
#
# USAGE: ./recdir.sh
#
# DESCRIPTION: will go in every directory and subdirectory starting from where you are and execute command
#
# OPTIONS: ---
# REQUIREMENTS: ---
# BUGS: ---
# NOTES: ---
# AUTHOR: iesaya (---), ---
# COMPANY: ---
# CREATED: 01/29/2010 11:50:44 AM CET
# REVISION: ---
#===============================================================================
set -o nounset # Treat unset variables as an error
sdir=`pwd` #starting point; it is important that you start at the right place
dir=`find . -type d` #will save the sub/directory tree in var
for i in $dir; do
cd $i #go into directory
touch i.was.here #exec command; here change to your rename command
cd $sdir #go back to start
done