In someone's reply to one of my posts (which I forgot), I remember
bash -c "somecommand \$1" bash $somevariable
instead of
bash -c "somecommand $somevariable"
I saw this example again in findutils manual
find -exec sh -c 'something "$@"' sh {} \;
instead of
find -exec sh -c "something {}" \;
Do the two examples have the same reason to use the first solution instead of the other solution? If yes, what is it?
Inspired Why does command injection not work in this example? and Is the following the only form of command injection in bash?