From owner-freebsd-hackers@FreeBSD.ORG Tue Feb 14 18:34:50 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 7E0511065677 for ; Tue, 14 Feb 2012 18:34:50 +0000 (UTC) (envelope-from matthewstory@gmail.com) Received: from mail-vw0-f54.google.com (mail-vw0-f54.google.com [209.85.212.54]) by mx1.freebsd.org (Postfix) with ESMTP id 356618FC13 for ; Tue, 14 Feb 2012 18:34:49 +0000 (UTC) Received: by vbbfa15 with SMTP id fa15so287805vbb.13 for ; Tue, 14 Feb 2012 10:34:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; bh=NBIWF/jYAsdY3pJJp9f3+HBxIKWgwjJdUTd91JPaSe8=; b=KCHXhg51bgunD7egxEHhKr7UJvpPWCKtRFpAyI9RnFKRZ3HJjPKJCS6kipwcay66oR 4DsFwwinZZtYKvUf/zw23GRYqojqFQMR95TGoX+Ao/AieJpiE9jwmdnuI3NPwyeNgRxQ xeqS2vlakhncu+LKNigV3Vo64+127rvq91Yms= MIME-Version: 1.0 Received: by 10.220.38.10 with SMTP id z10mr12468578vcd.48.1329244489485; Tue, 14 Feb 2012 10:34:49 -0800 (PST) Received: by 10.52.21.84 with HTTP; Tue, 14 Feb 2012 10:34:49 -0800 (PST) Date: Tue, 14 Feb 2012 13:34:49 -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: 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 18:34:50 -0000 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. -- regards, matt