From nobody@FreeBSD.org  Fri Jun 27 21:01:12 2008
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 1A7CD1065671
	for <freebsd-gnats-submit@FreeBSD.org>; Fri, 27 Jun 2008 21:01:12 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (www.freebsd.org [IPv6:2001:4f8:fff6::21])
	by mx1.freebsd.org (Postfix) with ESMTP id 1AC648FC22
	for <freebsd-gnats-submit@FreeBSD.org>; Fri, 27 Jun 2008 21:01:12 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (localhost [127.0.0.1])
	by www.freebsd.org (8.14.2/8.14.2) with ESMTP id m5RL1BoJ059647
	for <freebsd-gnats-submit@FreeBSD.org>; Fri, 27 Jun 2008 21:01:11 GMT
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.14.2/8.14.1/Submit) id m5RL1BlE059646;
	Fri, 27 Jun 2008 21:01:11 GMT
	(envelope-from nobody)
Message-Id: <200806272101.m5RL1BlE059646@www.freebsd.org>
Date: Fri, 27 Jun 2008 21:01:11 GMT
From: Dave Yost <Dave@Yost.com>
To: freebsd-gnats-submit@FreeBSD.org
Subject: xargs needs an option to use only newlines to delimit args
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         125057
>Category:       bin
>Synopsis:       xargs needs an option to use only newlines to delimit args
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Fri Jun 27 21:10:02 UTC 2008
>Closed-Date:    Sat Jun 28 10:14:14 UTC 2008
>Last-Modified:  Sat Jun 28 10:14:14 UTC 2008
>Originator:     Dave Yost
>Release:        Mac OS X
>Organization:
>Environment:
Darwin ip2 9.3.0 Darwin Kernel Version 9.3.0: Fri May 23 00:49:16 PDT 2008; root:xnu-1228.5.18~1/RELEASE_I386 i386
>Description:
It is very common nowadays to have lots of filenames with spaces in them.
The current solution to this is cumbersome:

find . - type f | tr '\012' '\000' | xargs -0 ls -ltr

Much easier and nicer would be something like this:

find . - type f | xargs -l ls -ltr

where -l is an option that tells xargs to treat each line of input as an argument to be quoted.
>How-To-Repeat:

>Fix:


>Release-Note:
>Audit-Trail:

From: Kris Kennaway <kris@FreeBSD.org>
To: Dave Yost <Dave@Yost.com>
Cc: freebsd-gnats-submit@FreeBSD.org
Subject: Re: misc/125057: xargs needs an option to use only newlines to delimit
 args
Date: Sat, 28 Jun 2008 11:39:02 +0200

 Dave Yost wrote:
 
 > It is very common nowadays to have lots of filenames with spaces in them.
 > The current solution to this is cumbersome:
 > 
 > find . - type f | tr '\012' '\000' | xargs -0 ls -ltr
 
 That is not the correct solution :-)
 
 find . -type f -print0 | xargs -0 ls -ltr
 
 The xargs manpage even mentions that -0 is the counterpart of find -print0.
 
 Kris
 
State-Changed-From-To: open->closed 
State-Changed-By: linimon 
State-Changed-When: Sat Jun 28 10:13:15 UTC 2008 
State-Changed-Why:  
kris has offered the canonical solution. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=125057 
>Unformatted:
