From owner-freebsd-hackers@FreeBSD.ORG Mon Apr 4 22:28:49 2011 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 DA5D51065676 for ; Mon, 4 Apr 2011 22:28:49 +0000 (UTC) (envelope-from yanegomi@gmail.com) Received: from mail-pz0-f54.google.com (mail-pz0-f54.google.com [209.85.210.54]) by mx1.freebsd.org (Postfix) with ESMTP id B13348FC15 for ; Mon, 4 Apr 2011 22:28:49 +0000 (UTC) Received: by pzk27 with SMTP id 27so1863499pzk.13 for ; Mon, 04 Apr 2011 15:28:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=a4PK2m+yAOv5PzlSS+PFtn4xwPWrnus9XeRO5CC2mX8=; b=BfUxcQnzZ87jW4GjkNa+LC3suUtcy/7ca3XdABZ17VNHWoGSnWB3IyknnqeXLYuWHO hpCv1rY90CgL1oncP4SqmY3H+dFDRwbcB02q8amlcfqQW6AFunqzjo/qBLp01QwY8yBX 0qJX5BbLJs6aTFExeir0YCLHbz2Saxbqufd3g= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; b=F5IgZ8JLoXBuiPjo9E1fo/ABMczlc8Aj71YHS0XOSb9iOP62BDk14ctgb087KDG6d1 IIsC3KMLwwPDYjbMR8gpmmyavcVBN1AlFGqeW/XkUZlHfGaiMDNbWHV8QPs4Ial0sqjr 9zZRiuhuhi3yNv0ArZXaFUkP+NBDJ4RoPMfwg= MIME-Version: 1.0 Received: by 10.143.153.13 with SMTP id f13mr6636659wfo.380.1301956128928; Mon, 04 Apr 2011 15:28:48 -0700 (PDT) Received: by 10.68.42.3 with HTTP; Mon, 4 Apr 2011 15:28:48 -0700 (PDT) In-Reply-To: <20110404.162515.125.1@DEV> References: <20110404.162515.125.1@DEV> Date: Mon, 4 Apr 2011 15:28:48 -0700 Message-ID: From: Garrett Cooper To: rank1seeker@gmail.com Content-Type: text/plain; charset=ISO-8859-1 Cc: freebsd-hackers@freebsd.org Subject: Re: Extending sed's exit codes functionality 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: Mon, 04 Apr 2011 22:28:49 -0000 On Mon, Apr 4, 2011 at 9:25 AM, wrote: > http://forums.freebsd.org/showthread.php?p=129996 gordon@'s observation seems valid: http://forums.freebsd.org/showpost.php?p=130007&postcount=2 ? Your other question about grep returning 141 was because it caught SIGPIPE, so probably a *csh bug (I wouldn't be surprised). When in doubt, simplify (and don't use csh)! $ csh -c "cat /sys/conf/NOTES | grep -m 1 '^device' /sys/conf/NOTES; echo \$?" device hwpmc # Driver (also a loadable module) 141 $ env ENV=/dev/null sh -c "cat /sys/conf/NOTES | grep -m 1 '^device' /sys/conf/NOTES; echo \$?" device hwpmc # Driver (also a loadable module) 0 You might want to ktrace/truss the piped process to figure out why it's catching SIGPIPE, and maybe submit a bug report once you figure out why csh isn't playing nicely. Happy hunting. Thanks, -Garrett