On 24.07.2015 11:46, Emanuele Rusconi wrote:
>> So my question is: How to make the script stop completely
>> when the error happens in the time {} block and not run the
>> rm -rf commands (and the next script, as the script is invoked
>> from a bootstrap script which also uses -e).
>
> {
> time {
> blah blah whatever
> }
> } 2>&1 | tee ${LOGDIR}/binutils-pass1-${BINUTILS_VER}.log
> [ $PIPESTATUS = 0 ] || exit 1
>
> -- Emanuele Rusconi
> Google hinted at PIPESTATUS but I was unaware of how to use it. Thanks for providing an example, it now works like a charm. -- Note: My last name is not Krejzi.
signature.asc
Description: OpenPGP digital signature
-- 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
