FOOL EXEC()ed SHELL TO THINK STDIN IS A TTY
From: Usha (u_sesh_at_yahoo.com)
Date: 04/25/03
- Next message: Eric Sosman: "Re: FOOL EXEC()ed SHELL TO THINK STDIN IS A TTY"
- Previous message: Måns Rullgård: "Re: Non-bloated window managers"
- Next in thread: Eric Sosman: "Re: FOOL EXEC()ed SHELL TO THINK STDIN IS A TTY"
- Reply: Eric Sosman: "Re: FOOL EXEC()ed SHELL TO THINK STDIN IS A TTY"
- Reply: Barry Margolin: "Re: FOOL EXEC()ed SHELL TO THINK STDIN IS A TTY"
- Reply: Marc Rochkind: "Re: FOOL EXEC()ed SHELL TO THINK STDIN IS A TTY"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Date: 25 Apr 2003 12:00:13 -0700
HI,
I am stumped! My C++ program fork()s and the child exec()s a "ksh".
The input to the child (KSH) comes from the parent thro' a pipe(). ie,
the STDIN of the child is dup()ed to be the read end of the pipe. The
parent gets its STDIN and redirects it to the child. The ksh is made
interactive just so that the prompt is displayed.
But the exec()ed shell does not behave like a normal shell. Some of
the problems I am experiencing when running commands from the exec()ed
ksh are:
1) I cannot use stty since the input device is not a tty.
2) When I telnet to another host, the userid is echoed in the next
line, after entering the userid at the "Login" prompt, and entering
<CR>. Also, the password gets echoed on the screen as I type. I tried
to use the "mode" feature of telnet to suppress echoing, but when I
use the esc character to get to the telnet prompt, it does not
understand the escape character, and thinks it is the login userid. I
am guessing it has to do with the input device not being a tty.
Does anybody know how to get around this problem? Is there a way to
fool the shell to think the input device is a tty and not a pipe, so
that it starts behaving normally ? Any help is truely appreciated.
Thanks in advance!
Usha
- Next message: Eric Sosman: "Re: FOOL EXEC()ed SHELL TO THINK STDIN IS A TTY"
- Previous message: Måns Rullgård: "Re: Non-bloated window managers"
- Next in thread: Eric Sosman: "Re: FOOL EXEC()ed SHELL TO THINK STDIN IS A TTY"
- Reply: Eric Sosman: "Re: FOOL EXEC()ed SHELL TO THINK STDIN IS A TTY"
- Reply: Barry Margolin: "Re: FOOL EXEC()ed SHELL TO THINK STDIN IS A TTY"
- Reply: Marc Rochkind: "Re: FOOL EXEC()ed SHELL TO THINK STDIN IS A TTY"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Relevant Pages
|