Skip to main content
4 of 9
added 134 characters in body
schily
  • 19.7k
  • 5
  • 41
  • 61

When you log in, stdin, stdout and stderr are connected to the terminal from where you log in. This allowd to read from stderr in order to get input from the termnal.

As mentioned in the other answer, programs read from stderr in order to get an interactive reply on a question.

Since a user cannot know under which circumstances a program reads from stderr, it is a useless attempt to intentionally write data into stderr from another program.

Note that today programs usually first try to open /dev/tty and use stderr only in case that does not work.

Programs that only read from stderr usually have never been modified sincce before 1979 and such programs usualy contain constructs like:

i =+ 1;

that are not accepted by modern C compilers. As a result, it is most unlikely that you today will find that never open /dev/tty but rather read interactive replies from stderr.

schily
  • 19.7k
  • 5
  • 41
  • 61