1 2 3 4 5 6 7 8 9
# $FreeBSD: releng/12.0/bin/sh/tests/builtins/for2.0 230463 2012-01-22 14:00:33Z jilles $ r=x f() { return 42; } f for i in x; do r=$? done [ "$r" = 42 ]