In the xargs command, the -I option allows you to specify a replacement string (or "needle") that will be replaced by the input arguments. If you do not explicitly provide a replacement string, the default needle string is %.
In your example:
bash(echo a && echo b) | xargs -I % echo "|%|"
The % is explicitly used as the replacement string, and it is replaced by each input argument (a and b), resulting in:
text|a| |b|
If you omit the -I option entirely, xargs will append the input arguments to the end of the command by default, without any replacement string. However, if you use -I without specifying a replacement string, % is the default.
Vibe can make mistakes. Check answers. Learn more