[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Weird process substitution behavior
From: |
John Dawson |
Subject: |
Weird process substitution behavior |
Date: |
Fri, 8 Nov 2013 17:26:54 -0600 |
The following surprised me. I thought line 4 of the output, and certainly
line 5 of the output, should have said "0 /dev/fd/63" too. Is this behavior
a bug?
$ cat bug1.bash
#!/bin/bash
count_lines()
{
wc -l $1
wc -l $1
wc -l $1
true | wc -l $1
wc -l $1
}
count_lines <(date)
$ ./bug1.bash
1 /dev/fd/63
0 /dev/fd/63
0 /dev/fd/63
wc: /dev/fd/63: No such file or directory
wc: /dev/fd/63: No such file or directory
I ran this on Bash 4.2.37(1)-release on Fedora Linux.
--
John Dawson <john.dawson@gmail.com>
- Weird process substitution behavior,
John Dawson <=