Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 28 Aug 1999 15:55:27 +0200 (MET DST)
From:      Luigi Rizzo <luigi@labinfo.iet.unipi.it>
To:        roger@cs.strath.ac.uk (Roger Hardiman)
Cc:        hackers@freebsd.org, luigi@freebsd.org, abial@freebsd.org
Subject:   Re: Help with exit status in shell script
Message-ID:  <199908281355.PAA15431@labinfo.iet.unipi.it>
In-Reply-To: <37C79822.D28CD168@cs.strath.ac.uk> from "Roger Hardiman" at Aug 28, 99 09:04:31 am

next in thread | previous in thread | raw e-mail | index | archive | help
> 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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199908281355.PAA15431>