Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

executing program on remote machine

executing program on remote machine

executing program on remote machine

I have a question related to c on unix.
Say there are two machines system1 and system2.
I have a hello world program which prints hello world.
I want to execute this hello world program on system1 and system2 and see the performance of both the systems.

Does unix provides any function/system call to execute the program on a remote machine ?
something like execute(machine name, name of the program)


RE: executing program on remote machine

Try RPCs.  These are different on different implementations so if your two machines are say SunOS and AIX, you may have platform specific code.

RE: executing program on remote machine

If you want to execute it on a single other machine, just do something like:


$ ssh you@wherever "command arg1 arg2"

If you want to execute it on multiple other machines in parallel, use a utility like shmux. There's a list of similar utilities at the bottom of the shmux page, so take your pick.

RE: executing program on remote machine

Thank you guys for your help. But I guess this doesn't solves my problem. Anyway, thanks.


RE: executing program on remote machine

RPC is not a good idea if it has to go over the internet.  RPC (like telnet and regular FTP) is sent in plain text and your passwords can be sniffed.

SSH is better solution.

If your comparing performance, use the time command on each machine instead of trying guesstimate by running them at the same time.

The question your asking isn't a programming question about C,  it's a question about the network technologies Unix has available.  Try the Unix forum for this type of question.

You'll have to first sftp the program to the other server then use ssh into it and run it.


Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close