bug-bash
[Top][All Lists]
Advanced

[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: Wed, 13 Nov 2013 14:18:15 -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 <address@hidden>


reply via email to

[Prev in Thread] Current Thread [Next in Thread]