```bash
(echo a && echo b) | xargs -I % echo "|%|"
```
```
|a|
|b|
```

What is default `-I` needle string?
Aug 4, 1:49pm

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.

Aug 4, 1:49pm

This is a shared conversation and may include unverified content that doesn't reflect Mistral AI's views. Login to resume chatting.

Vibe can make mistakes. Check answers. Learn more