On Mon, Jan 16, 2017 at 08:44:11AM -0700, Todd C. Miller wrote:
> On Mon, 16 Jan 2017 12:19:31 +0100, Andreas Kusalananda
> =?iso-8859-1?B?S+Ro5HJp
> ?= wrote:
>
> > However, when I use nul-termination instead:
> >
> > $ printf 'hello\00world\00' | xargs -0 -I arg printf '>%s<\n' "arg"
> > >hello world<
>
> This appears to be a bug with the -I handling. Without -I it
> works as expected:
>
> $ printf 'hello\00world\00' | xargs -0 printf '>%s<\n'
> >hello<
> >world<
As I said in the other mail: The -I separates at new LINES (in the
Code it sets the Parameter -L to 1, so it starts a new entry on every
non empty line.
Example:
$printf "This is\t a\nTest and\tso on" | xargs -I arg printf '>%s<\n' "arg"
>This is a<
>Test and so on<
If we use "-n 1" it splits every entry:
$printf "This is\t a\nTest and\tso on" | xargs -n 1 -I arg printf '>%s<\n' "arg"
>This<
>is<
>a<
>Test<
>and<
>so<
>on<