From owner-freebsd-hackers@FreeBSD.ORG Tue Feb 14 19:37:18 2012 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7EA551065675 for ; Tue, 14 Feb 2012 19:37:18 +0000 (UTC) (envelope-from matthewstory@gmail.com) Received: from mail-vx0-f182.google.com (mail-vx0-f182.google.com [209.85.220.182]) by mx1.freebsd.org (Postfix) with ESMTP id 3A0C38FC25 for ; Tue, 14 Feb 2012 19:37:17 +0000 (UTC) Received: by vcmm1 with SMTP id m1so357323vcm.13 for ; Tue, 14 Feb 2012 11:37:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=osEwxuA7YYtQta9E9FgUpg+ngwlN5dTkMmhD5F19Y5c=; b=rASPSdSVOepDgupxtdeyIHxu7r5zSN2eWWyzQ0wTl8AKCZG9G2ew8itl6YA/5gUMiA p1LECLQVSYaDWfoGh9v0wJNPb+dqBSambWo4Q7bnSWgkECFoQWn2X3pcFepoIN3QEhyI p/A4KBzfjEqOCHdkWDnBKlgzPmSRVXAwif+vs= MIME-Version: 1.0 Received: by 10.52.71.226 with SMTP id y2mr9720165vdu.78.1329248237555; Tue, 14 Feb 2012 11:37:17 -0800 (PST) Received: by 10.52.21.84 with HTTP; Tue, 14 Feb 2012 11:37:17 -0800 (PST) In-Reply-To: <20120214193530.GA42580@stack.nl> References: <20120214193530.GA42580@stack.nl> Date: Tue, 14 Feb 2012 14:37:17 -0500 Message-ID: From: Matthew Story To: freebsd-hackers@freebsd.org Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Subject: Re: xargs short-circuit X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Feb 2012 19:37:18 -0000 On Tue, Feb 14, 2012 at 2:35 PM, Jilles Tjoelker wrote: > On Tue, Feb 14, 2012 at 01:34:49PM -0500, Matthew Story wrote: > > After reading the man-page, and browsing around the internet for a > minute, > > I was just wondering if there is an option in (any) xargs to > short-circuit > > on first failure of [utility [arguments]]. > > > e.g. > > > $ jot - 1 10 | xargs -e -n1 sh -c 'echo "$*"; echo exit 1' worker || > echo $? > > 1 > > 1 > > > such that any non-0 exit code in a child process would cause xargs to > stop > > processing. seems like this would be a nice feature to have. > > As per xargs(1), you can do this by having the command exit on a signal > or with a value of 255. > Yes indeed it does ... should have scoured further, thanks! > > -- > Jilles Tjoelker > -- regards, matt