Path: utzoo!attcan!uunet!husc6!uwvax!dogie!uwmcsd1!ig!agate!.berkeley.edu!cotner
From: cotner@.berkeley.edu
Newsgroups: comp.unix.questions
Subject: Using the RPC rexec() command.
Message-ID: <13384@agate.BERKELEY.EDU>
Date: 18 Aug 88 01:23:22 GMT
Sender: usenet@agate.BERKELEY.EDU
Reply-To: cotner@.berkeley.edu ()
Organization: Math Dept., UC Berkeley
Lines: 19

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