blob: 01a7f591c840518a0b272ff036936596b4c6c36a [file] [log] [blame]
Mike Frysinger3c7167b2009-04-06 12:36:10 +00001# make sure we have a way of checking these things
2[ ! -e /dev/fd ] && exit 1
3
4[ -e /dev/fd/44 ] && exit 1
5exec 44>/dev/null
6[ -e /dev/fd/44 ] || exit 1
7echo pass fd out open
8
9[ -e /dev/fd/55 ] && exit 1
10exec 55>&44
11[ -e /dev/fd/55 ] || exit 1
12echo pass fd out dup
13
14exec 44>&-
15[ -e /dev/fd/44 ] && exit 1
16echo pass fd out close
17
18[ -e /dev/fd/66 ] && exit 1
19exec 66</dev/null
20[ -e /dev/fd/66 ] || exit 1
21echo pass fd in open
22
23[ -e /dev/fd/77 ] && exit 1
24exec 77<&66
25[ -e /dev/fd/77 ] || exit 1
26echo pass fd in dup
27
28exec 66<&-
29[ -e /dev/fd/66 ] && exit 1
30echo pass fd in close