On Tue, Feb 02, 2010 at 09:32:43PM +0100, Ingo Schwarze wrote:
> Antti Harri wrote on Tue, Feb 02, 2010 at 07:31:57PM +0200:
> 
> > xargs' -L switch isn't working when using -0 flag.
> 
> After checking POSIX.1 (2008), i conclude that our implementation and
> manual are correct in this respect.  The -L option is concerned
> with "lines of arguments from standard input".  ASCII nul characters
> do not delimit lines.
 
You seem to have misinterpreted the purpose of -print0 and -0. From
Linux find(1):

        -print0
        
        True; print the full file name on the standard output, followed
        by a null character (instead of the newline character that -print uses).
        This allows file names that contain newlines or other types of white
        space to be correctly interpreted by programs that process the find
        output. This option corresponds to the -0 option of xargs.
 
Using -0 for xargs simply means "Use \0 as otherwise \n or whitespace are
used". This also has nothing to do with POSIX compliancy, since using -0
in the first place breaks compliancy. 

> > Tested also on OS X and Linux and they print two lines with -0.
> 
> So you might wish to file bug reports with these operating systems.

I suggest OpenBSD rather change their -0 semantics to match those of
every other vendor which implement -0 in xargs. 
 
-- 
Atte Peltomdki
     atte.peltom...@iki.fi <> http://kameli.org
"Your effort to remain what you are is what limits you"

Reply via email to