exec1.0 revision 213738
1198453Sjilles# $FreeBSD: head/tools/regression/bin/sh/builtins/exec1.0 213738 2010-10-12 18:20:38Z obrien $ 2198453Sjilles 3213738Sobrienfailures= 4213738Sobrienfailure() { 5213738Sobrien echo "Error at line $1" >&2 6198453Sjilles failures=x$failures 7213738Sobrien} 8213738Sobrien 9213738Sobrien( 10198453Sjilles exec >/dev/null 11213738Sobrien echo bad 12213738Sobrien) 13213738Sobrien[ $? = 0 ] || failure $LINENO 14213738Sobrien( 15213738Sobrien exec ${SH} -c 'exit 42' 16213738Sobrien echo bad 17213738Sobrien) 18213738Sobrien[ $? = 42 ] || failure $LINENO 19213738Sobrien( 20213738Sobrien exec /var/empty/nosuch 21198453Sjilles echo bad 22213738Sobrien) 2>/dev/null 23213738Sobrien[ $? = 127 ] || failure $LINENO 24213738Sobrien 25213738Sobrientest -z "$failures" 26213738Sobrien