1157415Sstefanf# $FreeBSD: releng/10.2/bin/sh/tests/errors/redirection-error.0 213738 2010-10-12 18:20:38Z obrien $ 2157415SstefanfIFS=, 3157415Sstefanf 4157415SstefanfSPECIAL="break,\ 5157415Sstefanf :,\ 6157415Sstefanf continue,\ 7157415Sstefanf . /dev/null, 8157415Sstefanf eval, 9157415Sstefanf exec, 10157415Sstefanf export -p, 11157415Sstefanf readonly -p, 12157415Sstefanf set, 13157415Sstefanf shift, 14157415Sstefanf times, 15157415Sstefanf trap, 16157415Sstefanf unset foo" 17157415Sstefanf 18157415SstefanfUTILS="alias,\ 19157415Sstefanf bg,\ 20157415Sstefanf bind,\ 21157415Sstefanf cd,\ 22157415Sstefanf command echo,\ 23157415Sstefanf echo,\ 24157415Sstefanf false,\ 25157415Sstefanf fc -l,\ 26157415Sstefanf fg,\ 27157415Sstefanf getopts a -a,\ 28157415Sstefanf hash,\ 29157415Sstefanf jobs,\ 30157415Sstefanf printf a,\ 31157415Sstefanf pwd,\ 32157415Sstefanf read var < /dev/null,\ 33157415Sstefanf test,\ 34157415Sstefanf true,\ 35157415Sstefanf type ls,\ 36157415Sstefanf ulimit,\ 37157415Sstefanf umask,\ 38157415Sstefanf unalias -a,\ 39157415Sstefanf wait" 40157415Sstefanf 41157415Sstefanf# Special built-in utilities must abort on a redirection error. 42157415Sstefanfset -- ${SPECIAL} 43157415Sstefanffor cmd in "$@" 44157415Sstefanfdo 45213738Sobrien ${SH} -c "${cmd} > /; exit 0" 2>/dev/null && exit 1 46157415Sstefanfdone 47157415Sstefanf 48157415Sstefanf# Other utilities must not abort. 49157415Sstefanfset -- ${UTILS} 50157415Sstefanffor cmd in "$@" 51157415Sstefanfdo 52213738Sobrien ${SH} -c "${cmd} > /; exit 0" 2>/dev/null || exit 1 53157415Sstefanfdone 54