I\'m using find for a task and I noticed that when I do something like this:
find `pwd` -name \"file.ext\" -exec echo $(dirname {}) \\;
it will
So the problem is that $(...) or `...` starts a new shell before make the replacement.
Consider using bash -c:
$ find . -name '*.PNG' -exec bash -c 'git mv {} $(dirname {})/$(basename {} .PNG)48.png' \;
That renames any icon on a git repo to a more standard form.
Here {} is replaced before executing anything, so the problem is gone.
For that example, TMTOWTDI, but I try to keep it simple so you can start whatever you really need to do.