Find the answer to your Linux question:
Results 1 to 6 of 6
$ rsh mymachine.com ls stderr is not a tty - where are you? file1 file2 file3 Why am I getting this message "stderr is not a tty - where are ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Jul 2003
    Location
    UT Austin,TX, USA
    Posts
    10

    stderr is not a tty - where are you?


    $ rsh mymachine.com ls
    stderr is not a tty - where are you?
    file1
    file2
    file3

    Why am I getting this message "stderr is not a tty - where are you?". A google search was not very helpful. Searching on linuxforums.org gave one result which was not helpful either.

    TIA.

    PS: I am using rsh in another application and this message is conflicting with it.

  2. #2
    Linux Engineer
    Join Date
    Sep 2003
    Location
    Knoxhell, TN
    Posts
    1,078
    stderr is an i/o stream which usually points to a tty.. it looks to me as if one of the programs (rsh or the calling program) is trying to print output to stderr and finding that it is connected to a socket rather than a tty.. and so is trying to figure out why stderr is not on a tty.. i may be wrong, but that's what seems to be happening to me. stderr is generally used for error messages or other important messages.. stderr can not be redirected to another stream.. so it's messages can not be subdued by executing a command with the redirection operator (> or >>)..

  3. #3
    Linux Guru
    Join Date
    Oct 2001
    Location
    Täby, Sweden
    Posts
    7,578
    Oh, stderr can certainly be redirected: "ls 2>/dev/null", will show normal output but send stderr to the bitbucket.

    kallu, can you post the output of "ls -l /proc/$$/fd" before trying rsh?

  4. $spacer_open
    $spacer_close
  5. #4
    Linux Engineer
    Join Date
    Sep 2003
    Location
    Knoxhell, TN
    Posts
    1,078
    Dolda: hmm.. it seems that maybe the book i'm learning C from is more than just a bit slanted towards M$ stuff, then.. grr..

  6. #5
    Linux Guru
    Join Date
    Oct 2001
    Location
    Täby, Sweden
    Posts
    7,578
    lordnothing: In UNIX, stdin is defined as file descriptor 0, stdout as fd 1 and stderr as fd 2. Since open file descriptors are inhereted from the parent process when it forks, you can essentially send an arbitrary number of open files to a new program, as long as it's clearly defined on what file descriptors they should be. For example, the utempter program (which allows user programs to add and remove entries from utmp), requires that the master PTY end is passed on file descriptor 3.

  7. #6
    Just Joined!
    Join Date
    Jul 2003
    Location
    UT Austin,TX, USA
    Posts
    10
    kallu, can you post the output of "ls -l /proc/$$/fd" before trying rsh?[/quote]

    $ ls -l /proc/$$/fd
    total 0
    lrwx------ 1 * grad 64 Jan 26 00:04 0 -> /dev/pts/2
    lrwx------ 1 * grad 64 Jan 26 00:04 1 -> /dev/pts/2
    lrwx------ 1 * grad 64 Jan 26 00:04 2 -> /dev/pts/2
    lrwx------ 1 * grad 64 Jan 26 00:04 255 -> /dev/pts/2

    I will soon post what all's working.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •