Originally posted by: Casey_B
Hello Ross,
I think that you are fighting some globbing, or shell expansion problems.
Remember that you are trying to make sure that *.all is passed to the find command,
and not replaced by the shell with whatever is in the current directory that matches "*.all"
So for instance....
# cd /tmp/
# mkdir -p test/1
# touch ./test/base.all
# touch ./test/1/1.all
# find . -name *.all
./test/1/1.all
./test/base.all
# cd test
# This *.all will get expanded into "base.all" and passed to find.
# find . -name *.all
./base.all
# Backslash prevents *.all from being expanded in the current directory, and makes it pass to find.
# find . -name \*.all
./1/1.all
./base.all
If you run the find in a directory with "*.all" you will have different results.
Also in addition to that, you seem to have a typo as Rakesh noted in the second exec statement.
The shell expansion is made more difficult because you are trying to execute commands that are stored as
a list.
May I suggest that you instead look at set -x. You will get the logging of which command is being run, and
you will not need to try and store all of your commands in an array like that.
Hope this helps,
Casey
I think instead of trying to debug what is happening with the shell expansion, that you
should instead try to start from a little further back