Why are “{}” and “%” commonly used as replstr in xargs

xargs

I often see xargs -I {} or xargs -I % (less). Is there any reason why those two are commonly used? Why is {}, as longer and more likely to be bad-interpreted, preferred?

Best Answer

{} is also seen in find, and python. % has a long historical tradition in printf-family commands in most programming languages, but mostly as a prefix to sequences like %s or %d, so it's not the first thought to use it alone.

There is also a simpler reason. The -i switch that is now deprecated, implied {} if you didn't specify a different one. It appears that the original developers used this form (quite possibly inspired by find), and shipped a default setting and a rich series of example uses in tutorials that use {}. The rest of the users simply propagated this choice.