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