aboutsummaryrefslogtreecommitdiff
path: root/shell/ash_test/ash-redir/redir_leak.tests
blob: c8a9c6343b0d7f9813528f6ef2ace4931daa2718 (plain)
1
2
3
4
5
6
7
8
9
10
# Each of these should show only four lines:
# fds 0,1,2 are stdio; fd 3 is open by opendir() in ls.
# This test detects bugs where redirects leave stray open fds.

ls -1 /proc/self/fd | wc -l
ls -1 /proc/self/fd >/proc/self/fd/1 | wc -l
ls -1 /proc/self/fd >/proc/self/fd/1 2>&1 | wc -l
echo "`ls -1 /proc/self/fd `" | wc -l
echo "`ls -1 /proc/self/fd >/proc/self/fd/1 `" | wc -l
echo "`ls -1 /proc/self/fd >/proc/self/fd/1 2>&1 `" | wc -l