Unix Programming - redirect stdin/stdout from program started by execv

This is Interesting: Free IT Magazines  
Home > Archive > Unix Programming > September 2007 > redirect stdin/stdout from program started by execv





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author redirect stdin/stdout from program started by execv
Jarek

2007-09-21, 7:22 pm

Hello!

I want to control remote application using ssh. I know, how to redirect
stdin/stdout from ssh started by execv. The problem is that remote
application requires pseudo-terminal to work, but
when I'm trying to run ssh from execv with "-t", it says:

Pseudo-terminal will not be allocated because stdin is not a terminal

How can I convince ssh, that it is connected to pty ?

Thanks in advance

Jarek
Scott Lurndal

2007-09-21, 7:22 pm

Jarek <jarek@poczta.srv.pl> writes:
>Hello!
>
> I want to control remote application using ssh. I know, how to redirect
>stdin/stdout from ssh started by execv. The problem is that remote
>application requires pseudo-terminal to work, but
>when I'm trying to run ssh from execv with "-t", it says:
>
>Pseudo-terminal will not be allocated because stdin is not a terminal
>
>How can I convince ssh, that it is connected to pty ?
>
>Thanks in advance
>
>Jarek


create the pty yourself and attach it to fd 0/1/2 before execing ssh.

scott
Peter J. Holzer

2007-09-22, 1:17 pm

On 2007-09-21 21:21, Jarek <jarek@poczta.srv.pl> wrote:
> I want to control remote application using ssh. I know, how to redirect
> stdin/stdout from ssh started by execv. The problem is that remote
> application requires pseudo-terminal to work, but
> when I'm trying to run ssh from execv with "-t", it says:
>
> Pseudo-terminal will not be allocated because stdin is not a terminal
>
> How can I convince ssh, that it is connected to pty ?


Read the manual:

-t Force pseudo-tty allocation. This can be used to execute arbi‐
trary screen-based programs on a remote machine, which can be
very useful, e.g., when implementing menu services. Multiple -t
options force tty allocation, even if ssh has no local tty.

hp


--
_ | Peter J. Holzer | I know I'd be respectful of a pirate
|_|_) | Sysadmin WSR | with an emu on his shoulder.
| | | hjp@hjp.at |
__/ | http://www.hjp.at/ | -- Sam in "Freefall"
Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com