Some of my scripts use command substitution, and now I see that there are lots of files like these in /tmp:
prw-------   1 yuri   wheel          0 Dec 10 13:32 sh-np-1386738492
-rw-r--r--   1 yuri   wheel    3278909 Dec 10 14:54 sh-np-1386721176

Besides the obvious question why they aren't deleted in the end, two questions: Shouldn't bash delete the pipe files once the child process opened them? On most platforms the deleted pipe will function the same with the benefit that it will get deleted automatically. Why some of he files /tmp/sh-np-NNN are regular files, not pipes? When I look through code I see mkfifo call creates them. Shouldn't it always create fifos and not files?

bash-4.2.45
FreeBSD-9.2

Yuri

Reply via email to