Hacker News new | past | comments | ask | show | jobs | submit login

It is not, but (for reasons unknown to me) it doesn't quote parameters in the default mode. Consider:

touch "a b" ls | xargs rm # this won't work, rm gets two parameters ls | xargs -i,, rm ,, # this will work




https://pubs.opengroup.org/onlinepubs/9699919799/utilities/x...

>[..] arguments in the standard input are separated by unquoted <blank> characters [..]

As for -i, it is documented to be the same as -I, which, among other things, makes it so that "unquoted blanks do not terminate input items; instead the separator is the newline character."


Yeah, I misremembered. Here's an example, using "-n 1" so each split "thing" is passed to separate processes:

  $ printf "one two three\nfour five\n" | xargs -n 1 echo
  one
  two
  three
  four
  five




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: