[tech] /dev/fd on morwong

David Basden davidb at shikita.rcpt.to
Wed Dec 29 13:33:52 WST 2004


On Wed, Dec 29, 2004 at 12:43:06AM +0800, Alastair Irvine wrote:
> Howdy.  It seems that both bash and mutt on morwong are trying to use the
> /dev/fd directory, which doesn't exist.  Specifically, it is used by bash's
> Process Substitution feature and by mutt's Mail Key function.

(from the bash manpage on morwong to refresh memories, including mine)

| Process substitution is supported on systems that support named pipes
| (FIFOs) or the /dev/fd method of naming open files.  It takes the
| form of <(list) or >(list).  The process list is run with its input
| or output con- nected to a FIFO or some file in /dev/fd.  The name
| of this file is passed as an argument to the current command as the
| result of the expansion.  If the >(list) form is used, writing to the
| file will provide input for list.  If the <(list) form is used, the
| file passed as an argument should be read to obtain the output of list.

So, the following works on mussel:

	davidb at mussel:~$ cat <(echo fish)
	fish
	davidb at mussel:~$

But not on morwong:

	bash-2.02$ cat <(echo fish)
	cat: cannot open /dev/fd/63
	bash-2.02$

The 'cat' command is actually expanded to 'cat /dev/fd/63', because
bash is assuming that /dev/fd/63 is a node set up by the OS pointing
to file descriptor 63 for the current process.

For some reason, /dev/fd isn't setup on morwong, and morwong isn't
letting me in with my key.

Could someone please look at the fd(4) manpage on morwong, and 
set it up? It seems to be pretty simple, just hasn't been done
with this build.

David



More information about the tech mailing list