LinuxQuestions.org
Register a domain and help support LQ
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices

Reply
 
Search this Thread
Old 12-14-2006, 07:39 AM   #1
sharad
Member
 
Registered: Dec 2005
Posts: 48

Rep: Reputation: 15
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.
 
Old 12-14-2006, 07:42 AM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,415

Rep: Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968
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.
 
Old 12-14-2006, 08:14 AM   #3
anupamsr
Member
 
Registered: Sep 2004
Location: India
Distribution: Kubuntu, Archlinux, Suse, Gentoo, Mandrake
Posts: 370

Rep: Reputation: 30
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.
 
Old 12-14-2006, 08:38 AM   #4
matthewg42
Senior Member
 
Registered: Oct 2003
Location: UK
Distribution: Kubuntu 12.10 (using awesome wm though)
Posts: 3,530

Rep: Reputation: 63
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
 
Old 12-14-2006, 08:40 AM   #5
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,415

Rep: Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968
yeah absolutely, but in essence that just sends you back to an extneral program, so might as well stay within bash anyway.
 
Old 12-14-2006, 08:56 AM   #6
matthewg42
Senior Member
 
Registered: Oct 2003
Location: UK
Distribution: Kubuntu 12.10 (using awesome wm though)
Posts: 3,530

Rep: Reputation: 63
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...
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
remote execute a bash script vmware Linux - Enterprise 3 09-07-2006 04:01 PM
howto execute for loop on remote mach using shell script dsids Linux - Newbie 1 08-22-2006 04:07 AM
shell script to execute my c executable cranium2004 Programming 2 04-06-2005 06:26 AM
Remote Win Bat File execute Shell Script on AIX Server DriveMeCrazy AIX 5 05-26-2004 07:24 PM
Why cant i execute a perl script dude4you Linux - Newbie 2 03-02-2004 06:50 PM


All times are GMT -5. The time now is 05:17 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration