redir1.0 revision 273920
1273920Sjilles# $FreeBSD: head/bin/sh/tests/expansion/redir1.0 273920 2014-10-31 22:28:10Z jilles $ 2273920Sjilles 3273920Sjillesbad=0 4273920Sjillesfor i in 0 1 2 3; do 5273920Sjilles for j in 0 1 2 3 4 5 6 7; do 6273920Sjilles for k in 0 1 2 3 4 5 6 7; do 7273920Sjilles case $i$j$k in 8273920Sjilles 000) continue ;; 9273920Sjilles esac 10273920Sjilles set -- "$(printf \\$i$j$k@)" 11273920Sjilles set -- "${1%@}" 12273920Sjilles ff= 13273920Sjilles for f in /dev/null /dev/zero /; do 14273920Sjilles if [ -e "$f" ] && [ ! -e "$f$1" ]; then 15273920Sjilles ff=$f 16273920Sjilles fi 17273920Sjilles done 18273920Sjilles [ -n "$ff" ] || continue 19273920Sjilles if { true <$ff$1; } 2>/dev/null; then 20273920Sjilles echo "Bad: $i$j$k ($ff)" >&2 21273920Sjilles : $((bad += 1)) 22273920Sjilles fi 23273920Sjilles done 24273920Sjilles done 25273920Sjillesdone 26273920Sjillesexit $((bad ? 2 : 0)) 27