Deleted Added
full compact
assignment-error1.0 (207820) assignment-error1.0 (213738)
1# $FreeBSD: head/tools/regression/bin/sh/errors/assignment-error1.0 207820 2010-05-09 16:04:32Z jilles $
1# $FreeBSD: head/tools/regression/bin/sh/errors/assignment-error1.0 213738 2010-10-12 18:20:38Z obrien $
2IFS=,
3
4SPECIAL="break,\
5 :,\
6 continue,\
7 . /dev/null,\
8 eval,\
9 exec,\
10 export -p,\
11 readonly -p,\
12 set,\
13 shift,\
14 times,\
15 trap,\
16 unset foo"
17
18# If there is no command word, the shell must abort on an assignment error.
2IFS=,
3
4SPECIAL="break,\
5 :,\
6 continue,\
7 . /dev/null,\
8 eval,\
9 exec,\
10 export -p,\
11 readonly -p,\
12 set,\
13 shift,\
14 times,\
15 trap,\
16 unset foo"
17
18# If there is no command word, the shell must abort on an assignment error.
19sh -c "readonly a=0; a=2; exit 0" 2>/dev/null && exit 1
19${SH} -c "readonly a=0; a=2; exit 0" 2>/dev/null && exit 1
20
21# Special built-in utilities must abort on an assignment error.
22set -- ${SPECIAL}
23for cmd in "$@"
24do
20
21# Special built-in utilities must abort on an assignment error.
22set -- ${SPECIAL}
23for cmd in "$@"
24do
25 sh -c "readonly a=0; a=2 ${cmd}; exit 0" 2>/dev/null && exit 1
25 ${SH} -c "readonly a=0; a=2 ${cmd}; exit 0" 2>/dev/null && exit 1
26done
27
28# Other utilities must not abort; we currently still execute them.
26done
27
28# Other utilities must not abort; we currently still execute them.
29sh -c 'readonly a=0; a=1 true; exit $a' 2>/dev/null || exit 1
30sh -c 'readonly a=0; a=1 command :; exit $a' 2>/dev/null || exit 1
29${SH} -c 'readonly a=0; a=1 true; exit $a' 2>/dev/null || exit 1
30${SH} -c 'readonly a=0; a=1 command :; exit $a' 2>/dev/null || exit 1