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