1157415Sstefanf# $FreeBSD: releng/11.0/bin/sh/tests/errors/option-error.0 213738 2010-10-12 18:20:38Z obrien $
2157415SstefanfIFS=,
3157415Sstefanf
4157415SstefanfSPECIAL="break abc,\
5157415Sstefanf	continue abc,\
6157415Sstefanf	.,
7157415Sstefanf	exit abc,
8157415Sstefanf	export -x,
9157415Sstefanf	readonly -x,
10157415Sstefanf	return abc,
11157415Sstefanf	set -z,
12157415Sstefanf	shift abc,
13157415Sstefanf	trap -y,
14157415Sstefanf	unset -y"
15157415Sstefanf
16157415SstefanfUTILS="alias -y,\
17157415Sstefanf	cat -z,\
18157415Sstefanf	cd abc def,\
19157415Sstefanf	command break abc,\
20157415Sstefanf	expr 1 +,\
21157415Sstefanf	fc -z,\
22157415Sstefanf	getopts,\
23157415Sstefanf	hash -z,\
24157415Sstefanf	jobs -z,\
25157415Sstefanf	printf,\
26157415Sstefanf	pwd abc,\
27157415Sstefanf	read,\
28157415Sstefanf	test abc =,\
29157415Sstefanf	ulimit -z,\
30157415Sstefanf	umask -z,\
31157415Sstefanf	unalias -z,\
32157415Sstefanf	wait abc"
33157415Sstefanf
34157415Sstefanf# Special built-in utilities must abort on an option or operand error.
35157415Sstefanfset -- ${SPECIAL}
36157415Sstefanffor cmd in "$@"
37157415Sstefanfdo
38213738Sobrien	${SH} -c "${cmd}; exit 0" 2>/dev/null && exit 1
39157415Sstefanfdone
40157415Sstefanf
41157415Sstefanf# Other utilities must not abort.
42157415Sstefanfset -- ${UTILS}
43157415Sstefanffor cmd in "$@"
44157415Sstefanfdo
45213738Sobrien	${SH} -c "${cmd}; exit 0" 2>/dev/null || exit 1
46157415Sstefanfdone
47