bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: bash leaks sh-np-NNN files and pipes in /tmp/ when command substitut


From: Yuri
Subject: Re: bash leaks sh-np-NNN files and pipes in /tmp/ when command substitution is used
Date: Wed, 11 Dec 2013 10:14:30 -0800
User-agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:24.0) Gecko/20100101 Thunderbird/24.1.0

On 12/11/2013 07:20, Ryan Cunningham wrote:
Second, you should post the definition of 'do-filter', if 'do-filter' is not a 
binary (also post the definitions of other custom functions 'do-filter' calls; 
but do not post the complete script).


do-filter is some shell script running some other commands. I didn't think it mattered for this purpose. But in any case, it is one line script placed in a file and made executable:
gawk '{ print strftime("%Y-%m-%d %H:%M:%S"), $0; }'

Also, as a correction to your original message, a FIFO _is_ a file, just not a 
regular file.

Yes, it is a special kind of file, but it has a special type S_IFIFO and ls(1) shows it with 'p' type and it also has size=0. What was my point is that this FIFO is sometimes created as a proper FIFO:
prw-------   1 yuri   wheel          0 Dec 11 01:51 sh-np-1386834327
and sometimes as a regular (non-FIFO) file:
-rw-r--r--   1 yuri   wheel    3721815 Dec 11 02:00 sh-np-1386805482
And the code shows that only mkfifo(2) is used. (FIFO doesn't leave any persistent data when abandoned, but those files do leave data.) I am not sure why is that that it creates them as files? Doesn't it look strange?

Yuri



reply via email to

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