bug-bash
[Top][All Lists]
Advanced

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

bash blocking on exec assigning an output file descriptor to a fifo


From: Øyvind Hvidsten
Subject: bash blocking on exec assigning an output file descriptor to a fifo
Date: Tue, 14 Feb 2012 22:04:05 +0100
User-agent: Cathedral Secure Mail v0.8

Please correct any mistakes in my wording, as I would very much like to be able to use the correct terms when describing this. Also, please ask if anything is unclear :)

My problem occurs when I do the following:
mkfifo foo; exec 3<"foo"; echo done

This blocks on the exec statement, and never reaches the echo statement, even though I don't think I've asked bash to read from that file descriptor (yet). The plan was to use "read -t 0 <&3" at a later stage to check if something is available there.

The following series of statements will however not block and echo "done" immediately:
mkfifo foo; exec 3<>"foo"; echo done

This also blocks:
mkfifo foo; exec 3>"foo"; exec 3<"foo"; echo done

Why is this?

My current version of bash:
GNU bash, version 4.1.5(1)-release (x86_64-pc-linux-gnu)



reply via email to

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