xref: /freebsd/bin/sh/tests/builtins/command8.0 (revision f81cdf24ba5436367377f7c8e8f51f6df2a75ca7)
1IFS=,
2
3SPECIAL="break,\
4	:,\
5	continue,\
6	. /dev/null,\
7	eval,\
8	exec,\
9	export -p,\
10	readonly -p,\
11	set,\
12	shift 0,\
13	times,\
14	trap,\
15	unset foo"
16
17set -e
18
19# Check that special builtins can be executed via "command".
20
21set -- ${SPECIAL}
22for cmd in "$@"
23do
24	${SH} -c "v=:; while \$v; do v=false; command ${cmd}; done" >/dev/null
25done
26
27while :; do
28	command break
29	echo Error on line $LINENO
30done
31
32set p q r
33command shift 2
34if [ $# -ne 1 ]; then
35	echo Error on line $LINENO
36fi
37
38(
39	command exec >/dev/null
40	echo Error on line $LINENO
41)
42
43set +e
44! command shift 2 2>/dev/null
45