From owner-svn-src-head@freebsd.org Thu Jun 11 15:14:39 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D62A4335357; Thu, 11 Jun 2020 15:14:39 +0000 (UTC) (envelope-from fernape@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49jS7z5Lb9z3Zxb; Thu, 11 Jun 2020 15:14:39 +0000 (UTC) (envelope-from fernape@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B22331A332; Thu, 11 Jun 2020 15:14:39 +0000 (UTC) (envelope-from fernape@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 05BFEdKk044404; Thu, 11 Jun 2020 15:14:39 GMT (envelope-from fernape@FreeBSD.org) Received: (from fernape@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05BFEdHX044403; Thu, 11 Jun 2020 15:14:39 GMT (envelope-from fernape@FreeBSD.org) Message-Id: <202006111514.05BFEdHX044403@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: fernape set sender to fernape@FreeBSD.org using -f From: =?UTF-8?Q?Fernando_Apestegu=c3=ada?= Date: Thu, 11 Jun 2020 15:14:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r362060 - head/usr.bin/xargs X-SVN-Group: head X-SVN-Commit-Author: fernape X-SVN-Commit-Paths: head/usr.bin/xargs X-SVN-Commit-Revision: 362060 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Jun 2020 15:14:40 -0000 Author: fernape (ports committer) Date: Thu Jun 11 15:14:39 2020 New Revision: 362060 URL: https://svnweb.freebsd.org/changeset/base/362060 Log: xargs(1): Add EXAMPLES to man page Add EXAMPLES covering options I, J, L, n, P. While here, fix warning (STYLE: no blank before trailing delimiter: Fl P,) Bumping .Dd Approved by: bcr@ Differential Revision: https://reviews.freebsd.org/D25214 Modified: head/usr.bin/xargs/xargs.1 Modified: head/usr.bin/xargs/xargs.1 ============================================================================== --- head/usr.bin/xargs/xargs.1 Thu Jun 11 14:57:30 2020 (r362059) +++ head/usr.bin/xargs/xargs.1 Thu Jun 11 15:14:39 2020 (r362060) @@ -33,7 +33,7 @@ .\" $FreeBSD$ .\" $xMach: xargs.1,v 1.2 2002/02/23 05:23:37 tim Exp $ .\" -.Dd August 4, 2015 +.Dd June 11, 2020 .Dt XARGS 1 .Os .Sh NAME @@ -325,6 +325,32 @@ exits with a value of 126. If any other error occurs, .Nm exits with a value of 1. +.Sh EXAMPLES +Create a 3x3 matrix with numbers from 1 to 9. +Every +.Xr echo 1 +instance receives three lines as arguments: +.Bd -literal -offset indent +$ seq 1 9 | xargs -L3 echo +1 2 3 +4 5 6 +7 8 9 +.Ed +.Pp +Duplicate every line from standard input: +.Bd -literal -offset indent +$ echo -e "one\\ntwo\\nthree" | xargs -I % echo % % +one one +two two +three three +.Ed +.Pp +Execute at most 2 concurrent instances of +.Xr find 1 +every one of them using one of the directories from the standard input: +.Bd -literal -offset indent +echo -e "/usr/ports\\n/etc\\n/usr/local" | xargs -J % -P2 -n1 find % -name file +.Ed .Sh SEE ALSO .Xr echo 1 , .Xr find 1 , @@ -336,7 +362,7 @@ utility is expected to be .St -p1003.2 compliant. The -.Fl J , o , P, R +.Fl J , o , P , R and .Fl S options are non-standard