]>
Commit | Line | Data |
---|---|---|
deb63bfb | 1 | # $FreeBSD: head/bin/sh/tests/execution/redir7.0 220978 2011-04-23 22:28:56Z jilles $ |
71aad674 A |
2 | |
3 | failures=0 | |
4 | ||
5 | check() { | |
6 | if [ "$2" != "$3" ]; then | |
7 | echo "Failure at $1" >&2 | |
8 | failures=$((failures + 1)) | |
9 | fi | |
10 | } | |
11 | ||
12 | check $LINENO "$(trap "echo bye" EXIT; f() { :; }; f >/dev/null)" bye | |
13 | check $LINENO "$(trap "echo bye" EXIT; f() { :; }; { f; } >/dev/null)" bye | |
14 | check $LINENO "$(trap "echo bye" EXIT; f() { :; }; (f) >/dev/null)" bye | |
15 | check $LINENO "$(trap "echo bye" EXIT; f() { :; }; (f >/dev/null))" bye | |
16 | check $LINENO "$(${SH} -c 'trap "echo bye" EXIT; f() { :; }; f >/dev/null')" bye | |
17 | check $LINENO "$(${SH} -c 'trap "echo bye" EXIT; f() { :; }; { f; } >/dev/null')" bye | |
18 | check $LINENO "$(${SH} -c 'trap "echo bye" EXIT; f() { :; }; (f) >/dev/null')" bye | |
19 | check $LINENO "$(${SH} -c 'trap "echo bye" EXIT; f() { :; }; (f >/dev/null)')" bye | |
20 | ||
21 | exit $((failures > 0)) |