Add regression tests for /bin/sh.
[dragonfly.git] / tools / regression / bin / sh / errors / option-error.0
1 # $FreeBSD: src/tools/regression/bin/sh/errors/option-error.0,v 1.2 2010/10/12 18:20:38 obrien Exp $
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