Re: Executing Unix commands on a remote host using C

From: Pascal Bourguignon (spam_at_mouse-potato.com)
Date: 09/28/05


Date: Wed, 28 Sep 2005 22:16:01 +0200

Måns Rullgård <mru@inprovide.com> writes:

> Pascal Bourguignon <spam@mouse-potato.com> writes:
>
>> "Bader" <baderA@gmail.com> writes:
>>
>>> How can I implement the following in C/C++:
>>> 1. Create a sub-process
>>
>> fork(2)
>>
>>> to start
>>
>> exec(2)
>>
>>> an SSH session to a remote host
>>
>> ssh(1)
>>
>>> 2. Then using the created session within my program I need to
>>> issue/send multiple commands
>>
>> popen(2)
>> pipe(2)
>> write(2)
>
> popen(2) doesn't belong here.

Right, popen(2) doesn't exist. I meant popen(3).

-- 
__Pascal Bourguignon__                     http://www.informatimago.com/
Litter box not here.
You must have moved it again.
I'll poop in the sink.