I want to run the following code, but its not working:
int main ()
{
execlp("ssh user@192.168.170.155", "ssh user@192.168.170.155", NULL);
return 0;
}
But if I replace ssh with any other command(say ls) its working fine.
Thanks,
Yuvi
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Did you read the man page of execlp?
You probably want
The
execlpcould fail (e.g. ifsshis not in your$PATH)