[comp.unix.questions] Using the RPC rexec

cotner@.berkeley.edu (08/18/88)

Last time I asked how to use the rpc routines on the SUN.  I got a few
responses, suggesting that I fork and exec
		rsh machine some_command
However, I had wanted to avoid invoking the rsh, and call the rpc routines
directly.  

Can someone please show me how to set up and use the rexec(3N) routines
to execute a command on a remote machine?  I've tried to set up a client
socket, bind to a remote port address, and make the rexec() call, but
I haven't gotten too far.  (It may be that my port address is way off;
I've been using the last digit of the network address entry in the 
/etc/hosts file.  How do you get the proper port number of a remote 
machine?)

Please include an example or code fragment, if you would.

TIA
Carl 
cotner@bosco.Berkeley.EDU