Subject: bin/34182: [dM] xargs(1) manpage omission
To: None <,>
From: der Mouse <mouse@Rodents.Montreal.QC.CA>
List: netbsd-bugs
Date: 08/10/2006 20:10:01
>Number:         34182
>Category:       bin
>Synopsis:       [dM] xargs(1) -0 description incomplete
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    bin-bug-people
>State:          open
>Class:          doc-bug
>Submitter-Id:   net
>Arrival-Date:   Thu Aug 10 20:10:00 +0000 2006
>Originator:     der Mouse
>Release:        NetBSD 3.0
	Noticed on i386 2.1; verified present in i386 3.0 and -current
	as of xargs.1,v 1.17.
System: NetBSD [redacted] 3.0 NetBSD 3.0 (GENERIC) #0: Mon Dec 19 01:04:02 UTC 2005 i386
Architecture: i386
Machine: i386
	xargs(1)'s description of -0 fails to indicate that it not only
	changes the delimiter but also suppresses the various quoting
	mechanisms described.  (Well, except very indirectly, by citing
	it as suitable for use with find -print0, which doesn't quote.)
	Read the manpage.  Try something like
	printf ab\'cd\'ef\\\\gh\\0 | xargs -0 echo
	and notice that, contrary to the documentation, the quoting
	characters are preserved.

	This can of course be taken as either sw-bug or doc-bug; I
	class it as doc-bug because I believe the code is correct - the
	actual behaviour is a good deal more useful than the documented
	Relative to xargs.1,v 1.17:

	--- z	Thu Aug 10 14:28:06 2006
	+++ z+	Thu Aug 10 14:45:09 2006
	@@ -80,8 +80,9 @@
	 .It Fl 0
	 Use NUL
	-instead of whitespace as the argument separator.
	-This can be used in conjunction with the
	+instead of whitespace as the argument separator, and do not perform any
	+of the quoting described above (all non\-\e0 characters are treated
	+equivalently).  This can be used in conjunction with the
	 .Fl print0
	 option of
	 .Xr find 1 .

/~\ The ASCII				der Mouse
\ / Ribbon Campaign
 X  Against HTML
/ \ Email!	     7D C8 61 52 5D E7 2D 39  4E F1 31 3E E8 B3 27 4B