]> git.saurik.com Git - apple/shell_cmds.git/blob - sh/tests/errors/redirection-error.0
cb8c0b113c139c8e23d925bbc3138e0d73f11d6d
[apple/shell_cmds.git] / sh / tests / errors / redirection-error.0
1 # $FreeBSD$
2 IFS=,
3
4 SPECIAL="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 UTILS="alias,\
19 bg,\
20 bind,\
21 cd,\
22 command echo,\
23 echo,\
24 false,\
25 fc -l,\
26 fg,\
27 getopts a -a,\
28 hash,\
29 jobs,\
30 printf a,\
31 pwd,\
32 read var < /dev/null,\
33 test,\
34 true,\
35 type ls,\
36 ulimit,\
37 umask,\
38 unalias -a,\
39 wait"
40
41 # Special built-in utilities must abort on a redirection error.
42 set -- ${SPECIAL}
43 for cmd in "$@"
44 do
45 ${SH} -c "${cmd} > /; exit 0" 2>/dev/null && exit 1
46 done
47
48 # Other utilities must not abort.
49 set -- ${UTILS}
50 for cmd in "$@"
51 do
52 ${SH} -c "${cmd} > /; exit 0" 2>/dev/null || exit 1
53 done