Unix systems without /dev/stdin, /dev/stdout, and /dev/stderr?
Is there a POSIX system, Unix, or a Unix-like environment of some description, alive today, that does not implement /dev/stdin, /dev/stdout, and /dev/stderr as files in the filesystem?
Yes, at least per my example system below.
I'm not an expert in this system by any means; however, AIX 6.1, which wikipedia claims is:
one of five commercial operating systems that have versions certified to The Open Group's UNIX 03 standard (https://en.wikipedia.org/wiki/IBM_AIX)
does not appear to implement those file descriptors in the installation I have access to. As you can see, if using bash, it will behave as if they did exist for the purposes of redirection:
$ uname -s
AIX
$ echo $SHELL
/usr/bin/ksh
$ ls -al /dev/stdin
ls: 0653-341 The file /dev/stdin does not exist.
$ ls -al /dev/stdout
ls: 0653-341 The file /dev/stdout does not exist.
$ ls -al /dev/stderr
ls: 0653-341 The file /dev/stderr does not exist.
$ echo foo >/dev/stderr
The file access permissions do not allow the specified action.
ksh: /dev/stderr: 0403-005 Cannot create the specified file.
$ bash
bash-4.2$ ls /dev/stderr
ls: 0653-341 The file /dev/stderr does not exist.
bash-4.2$ echo foo >/dev/stderr
foo
As other commenters have mentioned, the following questions provide some interesting information as well:
- Portability of "> /dev/stdout"
- Portability of file descriptor links
I'm posting well after the initial posts but thought I'd add this comment for future viewers.
I get the same results writing to /dev/stdout as above on an AIX 6.1 system, but on an AIX 7.1 system it works as expected, so it looks support for /dev/stdout was added.
AIX 6.1 (ksh93)
echo "Hello" > /dev/stdout
ksh93: /dev/stdout: cannot create.
[The file access permissions do not allow the specified action.].
AIX 7.1 (ksh93)
echo "Hello" > /dev/stdout
Hello