From owner-freebsd-hackers Sat Aug 28 9:35:56 1999 Delivered-To: freebsd-hackers@freebsd.org Received: from labinfo.iet.unipi.it (labinfo.iet.unipi.it [131.114.9.5]) by hub.freebsd.org (Postfix) with SMTP id 3EA8614DED; Sat, 28 Aug 1999 09:35:46 -0700 (PDT) (envelope-from luigi@labinfo.iet.unipi.it) Received: from localhost (luigi@localhost) by labinfo.iet.unipi.it (8.6.5/8.6.5) id PAA15431; Sat, 28 Aug 1999 15:55:27 +0200 From: Luigi Rizzo Message-Id: <199908281355.PAA15431@labinfo.iet.unipi.it> Subject: Re: Help with exit status in shell script To: roger@cs.strath.ac.uk (Roger Hardiman) Date: Sat, 28 Aug 1999 15:55:27 +0200 (MET DST) Cc: hackers@freebsd.org, luigi@freebsd.org, abial@freebsd.org In-Reply-To: <37C79822.D28CD168@cs.strath.ac.uk> from "Roger Hardiman" at Aug 28, 99 09:04:31 am X-Mailer: ELM [version 2.4 PL23] Content-Type: text Content-Length: 759 Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG > Hi, > There is a bug in the PicoBSD build shell script in and I have no idea > how to fix it. As a result, build errors are not caught. > It is all to do with Exit Status of programs called from a shell script. > Please help. > > The code fragment from /usr/src/release/picobsd/build/build is > ./stage1 2>&1 | tee stage1.out given that there is, in the same script, a "fail" procedure to handle such cases, i believe you could do something like (./stage1 2>&1 || fail $? stage1_failed ) | tee stage1.out (where the $? has nothing special, just that the "fail" procedre expects the errcode as first argument). If it turns out to be problematic, for 3.3R you could as well remove the "tee", after all it was just there for debugging. cheers luigi To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message