LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   perl script to execute my a c executable on remote machin (https://www.linuxquestions.org/questions/linux-general-1/perl-script-to-execute-my-a-c-executable-on-remote-machin-510358/)

sharad 12-14-2006 06:39 AM

perl script to execute my a c executable on remote machin
 
Hello,
I wanted to run my C executable on remote machine. I can do it by using shell scripts but I want to do it by using perl script.
Could you please tell me how to write the perl script. I would appreciate if you could tell me the solution.

Thanks and Regards,
sharad.

acid_kewpie 12-14-2006 06:42 AM

why would you want to do it in perl? the best way is going to be to shell out to system commands anyway, so you'll not benefit from using perl if all you're doing is system called to other programs like ssh.

anupamsr 12-14-2006 07:14 AM

Yeah, bash will the way to do it. Probably this thread will be helpful: http://www.linuxquestions.org/questi...d.php?t=469902

PS: I didnt complete my script.

matthewg42 12-14-2006 07:38 AM

How do you do it with a shell script? You could use system() in perl to do the same command
Code:

system("your command here");
Use this command from the shell to get info on the perl system command with code examples on how to check the error status of the command:
Code:

perldoc -f system

acid_kewpie 12-14-2006 07:40 AM

yeah absolutely, but in essence that just sends you back to an extneral program, so might as well stay within bash anyway.

matthewg42 12-14-2006 07:56 AM

Quote:

Originally Posted by acid_kewpie
yeah absolutely, but in essence that just sends you back to an extneral program, so might as well stay within bash anyway.

Yeah, except if it's part of the larger program which is already in Perl...


All times are GMT -5. The time now is 07:49 AM.