]> git.saurik.com Git - apple/shell_cmds.git/blob - sh/tests/errors/option-error.0
shell_cmds-198.tar.gz
[apple/shell_cmds.git] / sh / tests / errors / option-error.0
1 # $FreeBSD$
2 IFS=,
3
4 SPECIAL="break abc,\
5 continue abc,\
6 .,
7 exit abc,
8 export -x,
9 readonly -x,
10 return abc,
11 set -z,
12 shift abc,
13 trap -y,
14 unset -y"
15
16 UTILS="alias -y,\
17 cat -z,\
18 cd abc def,\
19 command break abc,\
20 expr 1 +,\
21 fc -z,\
22 getopts,\
23 hash -z,\
24 jobs -z,\
25 printf,\
26 pwd abc,\
27 read,\
28 test abc =,\
29 ulimit -z,\
30 umask -z,\
31 unalias -z,\
32 wait abc"
33
34 # Special built-in utilities must abort on an option or operand error.
35 set -- ${SPECIAL}
36 for cmd in "$@"
37 do
38 ${SH} -c "${cmd}; exit 0" 2>/dev/null && exit 1
39 done
40
41 # Other utilities must not abort.
42 set -- ${UTILS}
43 for cmd in "$@"
44 do
45 ${SH} -c "${cmd}; exit 0" 2>/dev/null || exit 1
46 done