Denys Vlasenko | 86584e1 | 2017-01-07 10:15:01 +0100 | [diff] [blame] | 1 | # Each of these should show only four lines: |
| 2 | # fds 0,1,2 are stdio; fd 3 is open by opendir() in ls. |
| 3 | # This test detects bugs where redirects leave stray open fds. |
| 4 | |
| 5 | ls -1 /proc/self/fd | wc -l |
| 6 | ls -1 /proc/self/fd >/proc/self/fd/1 | wc -l |
| 7 | ls -1 /proc/self/fd >/proc/self/fd/1 2>&1 | wc -l |
| 8 | echo "`ls -1 /proc/self/fd `" | wc -l |
| 9 | echo "`ls -1 /proc/self/fd >/proc/self/fd/1 `" | wc -l |
| 10 | echo "`ls -1 /proc/self/fd >/proc/self/fd/1 2>&1 `" | wc -l |