1 2 3
# $FreeBSD: releng/12.0/bin/sh/tests/builtins/trap9.0 230211 2012-01-16 10:59:44Z dumbbell $ test "$(trap 'printf trap; echo ped' EXIT; f() { :; }; f)" = trapped || exit 1