From owner-freebsd-hackers@FreeBSD.ORG Mon Nov 4 03:14:17 2013 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id A0C9C46F for ; Mon, 4 Nov 2013 03:14:17 +0000 (UTC) (envelope-from lists@eitanadler.com) Received: from mail-qc0-x230.google.com (mail-qc0-x230.google.com [IPv6:2607:f8b0:400d:c01::230]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 6122323D1 for ; Mon, 4 Nov 2013 03:14:16 +0000 (UTC) Received: by mail-qc0-f176.google.com with SMTP id s19so3728079qcw.35 for ; Sun, 03 Nov 2013 19:14:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=eitanadler.com; s=0xdeadbeef; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; bh=jTQvQDQ4n7q5DgFAwKqnzGoIUb3enRoUZn/tZjhef1E=; b=jnFsxAzOBeYKSuuuXmmwUzMxg1VNBgKZ4KdfzqEFCp1vnaxf6KmZp5W+gLdnvrDoJH d798HdXU8t0pX2/wDo/jzl3tD58SeKivMUtsd5D2D1PVyG+FUQbIef2C+/ibqGX2niFj fcqHX/tl3Z2YVCPQn9b58PsgCyvyPwtp8CS7M= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc:content-type; bh=jTQvQDQ4n7q5DgFAwKqnzGoIUb3enRoUZn/tZjhef1E=; b=m743zLk+VeEnuneVwtvRvslj+tQKO6CGXlLkSh10SaOlaAfE6QJLSs+R4MolkayL9x 8acu6PB65/XbPEpmnwQGVlGpbKrJ576vyjHnOeeCMP/fPaKhoFJzTecv7UrImfmgCh+Y 3SWi3xM1ecEgjS7WQjqJFgSnZ77CH3cUQC1zH2BuAm1/2amlCn0bkjF4s4k9/3NX7lXq eNsrOPq8MKBQeCSEFsxy+tXdVpBfEKWiaM5DF270QHg/O/5pAWIUMPDvGEzr7HMj9MGD bigL4Hzi4BPW55GMt4QLSka/yeQP8boydV3GAW2s6/LU6L2FWJELwP84D/tWauF83I+5 qAXA== X-Gm-Message-State: ALoCoQmDm7K8rrp1ziQo2aIat4frCNSSxhnyDJqh1ejoJXvEzO4cY+yT3BQkitkCYrM98s+8P2mm X-Received: by 10.229.172.3 with SMTP id j3mr19489363qcz.10.1383534856149; Sun, 03 Nov 2013 19:14:16 -0800 (PST) MIME-Version: 1.0 Received: by 10.96.63.101 with HTTP; Sun, 3 Nov 2013 19:13:45 -0800 (PST) In-Reply-To: <52770D8E.2030906@freebsd.org> References: <526F8EB3.1040205@freebsd.org> <20131103212950.GA22571@stack.nl> <52770D8E.2030906@freebsd.org> From: Eitan Adler Date: Sun, 3 Nov 2013 22:13:45 -0500 Message-ID: Subject: Re: Automated submission of kernel panic reports To: Colin Percival Content-Type: text/plain; charset=UTF-8 Cc: FreeBSD Hackers , Jilles Tjoelker X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.14 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 Nov 2013 03:14:17 -0000 On Sun, Nov 3, 2013 at 9:59 PM, Colin Percival wrote: > On 11/03/13 13:29, Jilles Tjoelker wrote: >> Some remarks about panicmail: >> >>> local tmpfile=`mktemp` || exit 1 >> >> This kind of thing does not do what you expect. The 'local' utility >> returns 0 because it successfully created the local variable, ignoring >> the status from the command substitution. Use >> local tmpfile >> tmpfile=`mktemp` || exit 1 >> in both occurrences. > > Wow, I had no idea. I guess it never occurred to me that 'local' would > even *have* an exit status... It can even exit non-zero: $ foo() { readonly bar; local bar="f"; echo $?; }; foo; local: bar: is read only 2 -- Eitan Adler