I was writing an answer to a question on Stack Overflow, and the answer involved a nested for loop similar tofor jpeg in **/foo.jpg; do    d=${f%/foo.jpg}   # Directory containing foo.jpg    for m4a in $d/*.m4a; do        someCommand $m4a --arg $jpeg     donedoneI had this idea to make the whole thing into a single find command that used another find command in its -exec primary, something like:find . -type d -exec test -f {}/foo.jpg \;               -exec find {} -name '*.m4a' \                             -exec someCommand ??? --args {}/foo.jpg \;The problem is with the ???. I would want to pass a literal {} to be used as an argument in the nested find's -exec without the outer find replacing it with a directory name as it would with {}/foo.jpg.The POSIX standard doesn't really say anything about passing a literal {} as an argument to a command. It only saysIf a utility_name or argument string contains the two characters {}, but not just the two characters {}, it is implementation-defined whether find replaces those two characters or uses the string without change.This would seem to preclude some sort of trickery involving sh -c, like-exec sh -c 'someCommand {} --args $1' _ {}/foo.jpg \;since {} may or may not be replaced by the outer find.So, is there any way to nest find in this fashion?
Pass literal {} as an argument in find -exec
find