Subject: Re: echo foo > /dev/stdout
To: Jan Schaumann <jschauma@netmeister.org>
From: Steven M. Bellovin <smb@cs.columbia.edu>
List: netbsd-users
Date: 08/21/2007 20:52:49
On Tue, 21 Aug 2007 16:02:59 -0700
Jan Schaumann <jschauma@netmeister.org> wrote:

> Hello,
> 
> I'm having one of these brain things, where I don't get why the shell
> is doing what it's doing, even though there's likely a very easy
> explanation:
> 
> $ echo foo >/dev/stdout
> foo
> $ cat >foo.sh <<EOS
> echo foo >/dev/stdout
> EOS
> $ sh foo.sh
> foo.sh: cannot create /dev/stdout: error 9
> $ 
> 
> Huh?
> 
What shell do you use?  As I understand it, /dev/stdout is only
available on NetBSD if you mount fdesc (see mount_fdesc(8)).  But ksh
fakes it.

b129$ ksh
b129$ echo foo >/dev/stdout 
foo
b130$ ^D
b130$ sh
b!$ echo foo >/dev/stdout
sh: cannot create /dev/stdout: error 9



		--Steve Bellovin, http://www.cs.columbia.edu/~smb