when I execute xargs -n2
, enter x x x x x
and hit Enter, I get only 4 x back:
$ xargs -n2
x x x x x
x x
x x
But, when I pipe the x x x x x
into the same command, I get the same amount of x back:
$ echo x x x x x | xargs -n2
x x
x x
x
why is it that in the first scenario the amount of arguments is either rounded up or rounded down ?
Ctrl+D
it'll print the remainingx
too. See How to signal the end of stdin input – don_crissti Mar 24 '15 at 12:31