From owner-freebsd-questions@freebsd.org Sun Oct 18 21:54:25 2020 Return-Path: Delivered-To: freebsd-questions@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 B851E43D887 for ; Sun, 18 Oct 2020 21:54:25 +0000 (UTC) (envelope-from johnl@iecc.com) Received: from gal.iecc.com (gal.iecc.com [IPv6:2001:470:1f07:1126:0:43:6f73:7461]) (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 (2048 bits) client-digest SHA256) (Client CN "gal.iecc.com", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CDtvg6LP0z3WgG for ; Sun, 18 Oct 2020 21:54:23 +0000 (UTC) (envelope-from johnl@iecc.com) Received: (qmail 86367 invoked from network); 18 Oct 2020 21:54:22 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=simple; d=iecc.com; h=date:message-id:from:to:cc:subject:in-reply-to:mime-version:content-type:content-transfer-encoding; s=1515d.5f8cb98e.k2010; bh=mkYWk+MjWz8gpl0LMP0FHKD+X8cQQRGSkw6IMUg03Fk=; b=o3nNGOzpBH94EsaBjy2VbFoUZQPKzvB9RbyR+6ofGNfsPtgbTWu96cdqyiVYilmJYUTtKK8Z2dSf+EovNyeq4/qEEHO4PRWdLMgB/8LsDbObX3uOhbuIA8Lm6zixYdVPFKm0vLxe/pJ6tuS9y33EddTf0q9LRequxwo/vvzLn7PP+0Q8HzGB+MV2/UaahBh44j/qdJv88EKRE4XHEGKNh+TxEvuN1ceX+FUPS0rAcuVCIJy5oRx79H7btrbCBonTIcS0nzibBfIP3FI7zsFQ280zWHqMPihCsmnR8Mnf3J239emEKnESlPTSHb3EIPdMKuBP0vj/vNk7bzwn8dOASw== Received: from ary.qy ([IPv6:2001:470:1f07:1126::78:696d:6170]) by imap.iecc.com ([IPv6:2001:470:1f07:1126::78:696d:6170]) with ESMTPS (TLS1.2 ECDHE-RSA AES-256-GCM AEAD) via TCP6; 18 Oct 2020 21:54:21 -0000 Received: by ary.qy (Postfix, from userid 501) id 6BA9B23A1462; Sun, 18 Oct 2020 17:54:20 -0400 (EDT) Date: 18 Oct 2020 17:54:20 -0400 Message-Id: <20201018215421.6BA9B23A1462@ary.qy> From: "John Levine" To: freebsd-questions@freebsd.org Cc: bob@proulx.com Subject: Re: sh scripting question In-Reply-To: <20201018144327254822114@bob.proulx.com> Organization: Taughannock Networks X-Headerized: yes Mime-Version: 1.0 Content-type: text/plain; charset=utf-8 Content-transfer-encoding: 8bit X-Rspamd-Queue-Id: 4CDtvg6LP0z3WgG X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=iecc.com header.s=1515d.5f8cb98e.k2010 header.b=o3nNGOzp; dmarc=pass (policy=none) header.from=iecc.com; spf=pass (mx1.freebsd.org: domain of johnl@iecc.com designates 2001:470:1f07:1126:0:43:6f73:7461 as permitted sender) smtp.mailfrom=johnl@iecc.com X-Spamd-Result: default: False [-4.66 / 15.00]; RCVD_TLS_ALL(0.00)[]; ARC_NA(0.00)[]; R_DKIM_ALLOW(-0.20)[iecc.com:s=1515d.5f8cb98e.k2010]; NEURAL_HAM_MEDIUM(-1.09)[-1.094]; FROM_HAS_DN(0.00)[]; DWL_DNSWL_MED(-2.00)[iecc.com:dkim]; MV_CASE(0.50)[]; R_SPF_ALLOW(-0.20)[+ip6:2001:470:1f07:1126::/64]; MIME_GOOD(-0.10)[text/plain]; TO_DN_NONE(0.00)[]; NEURAL_HAM_LONG(-0.97)[-0.966]; HAS_ORG_HEADER(0.00)[]; TO_MATCH_ENVRCPT_SOME(0.00)[]; DKIM_TRACE(0.00)[iecc.com:+]; RCPT_COUNT_TWO(0.00)[2]; DMARC_POLICY_ALLOW(-0.50)[iecc.com,none]; NEURAL_HAM_SHORT(-0.11)[-0.106]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; RCVD_COUNT_TWO(0.00)[2]; ASN(0.00)[asn:6939, ipnet:2001:470::/32, country:US]; MAILMAN_DEST(0.00)[freebsd-questions] X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Oct 2020 21:54:25 -0000 In article <20201018144327254822114@bob.proulx.com> you write: >> Since find is in use, I think the canonical solution is >> to use "find -print0"..."xargs -0" >Here is an example, I will use a "ls -ld" command just to make it a >real concrete example and perhaps easier to read that way. > > find . -exec ls -ld {} + Sometimes that's better, sometimes not. I have find scripts that delete stale files, and it is a lot faster to use xargs to run "rm" once for each thousand files than once per file. -- Regards, John Levine, johnl@taugh.com, Primary Perpetrator of "The Internet for Dummies", Please consider the environment before reading this e-mail. https://jl.ly