> And each
> command is followed by an error check and if there's an error, the
> script will bail out.  It checks the error code with this:
> 
> function check4errors()
> {
>  if [ $? != 0 ]
>   then 
>   [ "$1" != "" ] && logError $1 exit 1
>   fi
> }
> 
> It simply logs by writing to a file.

May I suggest something like this:

#!/bin/bash -e
...
(make 2>&1 | tee log.make && exit $PIPESTATUS) &&
...

This way you'll see thing whipping past as long as there are no return codes, 
but if something does error out, the script will stop and you'll have a file of 
the console log to dissect.  PIPESTATUS isn't very well known but works a charm 
in this application.  I've been doing this for 15 years. ;-)


-- 
Paul Rogers
[email protected]
Rogers' Second Law: "Everything you do communicates."
(I do not personally endorse any additions after this line. TANSTAAFL :-)
-- 
http://lists.linuxfromscratch.org/listinfo/lfs-support
FAQ: http://www.linuxfromscratch.org/blfs/faq.html
Unsubscribe: See the above information page

Do not top post on this list.

A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing in e-mail?

http://en.wikipedia.org/wiki/Posting_style

Reply via email to