From owner-freebsd-questions@FreeBSD.ORG Tue Jul 1 04:37:22 2014 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 34CA2480 for ; Tue, 1 Jul 2014 04:37:22 +0000 (UTC) Received: from relay2.tomsk.ru (mail.sibptus.tomsk.ru [212.73.124.5]) by mx1.freebsd.org (Postfix) with ESMTP id 9061E29E3 for ; Tue, 1 Jul 2014 04:37:19 +0000 (UTC) X-Virus-Scanned: by clamd daemon 0.98.1 for FreeBSD at relay2.tomsk.ru Received: from admin.sibptus.tomsk.ru (account sudakov@sibptus.tomsk.ru [212.73.125.240] verified) by relay2.tomsk.ru (CommuniGate Pro SMTP 5.1.16) with ESMTPSA id 35876278 for freebsd-questions@freebsd.org; Tue, 01 Jul 2014 11:37:16 +0700 Received: from admin.sibptus.tomsk.ru (sudakov@localhost [127.0.0.1]) by admin.sibptus.tomsk.ru (8.14.7/8.14.7) with ESMTP id s614bFZO007522 for ; Tue, 1 Jul 2014 11:37:16 +0700 (NOVT) (envelope-from vas@mpeks.tomsk.su) Received: (from sudakov@localhost) by admin.sibptus.tomsk.ru (8.14.7/8.14.7/Submit) id s614bF2x007521 for freebsd-questions@freebsd.org; Tue, 1 Jul 2014 11:37:15 +0700 (NOVT) (envelope-from vas@mpeks.tomsk.su) X-Authentication-Warning: admin.sibptus.tomsk.ru: sudakov set sender to vas@mpeks.tomsk.su using -f Date: Tue, 1 Jul 2014 11:37:15 +0700 From: Victor Sudakov To: freebsd-questions@freebsd.org Subject: Re: long string using find and "-exec ls -ls" to find part-of filename Message-ID: <20140701043715.GB4635@admin.sibptus.tomsk.ru> References: <20140630045605.GA11147@ethic.thought.org> <53B0EFF2.80205@calorieking.com> <20140630053004.GB16901@ethic.thought.org> <20140630064044.GA25085@ethic.thought.org> <20140630230316.44ec3257.freebsd@edvax.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20140630230316.44ec3257.freebsd@edvax.de> Organization: AO "Svyaztransneft", SibPTUS X-PGP-Key: http://www.dreamwidth.org/pubkey?user=victor_sudakov X-PGP-Fingerprint: 10E3 1171 1273 E007 C2E9 3532 0DA4 F259 9B5E C634 User-Agent: Mutt/1.5.21 (2010-09-15) X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Jul 2014 04:37:22 -0000 Polytropon wrote: > Allow me to add one little reminder: > > When using xargs, usually _one_ program will be executed > with a command line containing _all_ results of the find > command. If you want to run a program on _each_ of the > results, this is the typical sh solution: > > find ... | while read F; do > somecommand $F > done It's easier to use "xargs -n1" which I do all the time. -- Victor Sudakov, VAS4-RIPE, VAS47-RIPN sip:sudakov@sibptus.tomsk.ru