bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

set -e behaviour. Seems bug. Not the subshell issue!


From: Марк Коренберг
Subject: set -e behaviour. Seems bug. Not the subshell issue!
Date: Tue, 11 Sep 2012 17:51:02 +0600

Hello.

Example:
---------------------------------------
#!/bin/bash

set -e -u -E -T

fun()
{
    echo 'Execute really bad command:'
    /bin/false
    echo 'should not print this'
    return 0
}

if ! fun; then
    echo 'should catch fault here'
fi

fun
---------------------------------------

"should not print this"  should not be printed (as I think) in any case.
But in first case, it's printed, in second - is not.

(I have tested in bash 2.0 ... 4.2.24)

Is any way to force "set -e" to work even in such cases?

If this question asked 1000 times, why not to answer in FAQ (
http://tiswww.case.edu/php/chet/bash/FAQ)?

-- 
Segmentation fault


reply via email to

[Prev in Thread] Current Thread [Next in Thread]