From: CSBVAX::[email-masked]@SMTP 29-MAR-1988 21:20
To: ARISIA::EVERHART

Date: Tue, 29 Mar 88 12:34:02 EST
From: Peter Marshall <[email-masked]>
To: [email-masked]
Subject: rexec client for CMU-TEK

I sent out a message earlier this month asking for a program that
would allow me to query a printer queue on a Unix machine from our VMS
ones.  Kevin Carosso, [email-masked] (Innosoft International Inc.)
was kind enough to send me a copy of his rexec client program.  It
solves the problem nicely.

The code is available but is 76 blocks, so I will not include it in
this message.  Since we don't have a bliss compiler, Kevin was kind
enough to send us the .EXE file.  I would be happy to distribute the
source out to others, or post it to the list if there is enough
demand.  The .EXE file may be a problem, but I can /VMSDUMP it to any
JNET site on the greater BITNET or use uuencode.

I wrote up a quick help file (borrowing from the comments at the top
of the program) for the program and I will include it here.

Execute Commands on a Remote Machine

Rexec is an experimental utility that opens a TCP connection to a
remote execution server (rexecd).  Typically rexecd runs on a remote
UNIX machine.  Rexec allows one command to be sent to another system
and executed there with input and output appearing back on the local
system.

DCL command format is:

$ rexec [/username = {current-username} ] host-name remote-command
        [/password= ]
        [/input = {NL:} ]
        [/output = {SYS$OUTPUT} ]
        [/error = {SYS$ERROR} ]
        [/service_port = {512} ]

        If the username is not given it will default to your VMS username
        converted to lowercase and truncated to 8 characters.

        host-name = some known host (with an IP rexecd running)
        remote-command = a command to be executed on the remote host

        The password will be prompted for (with noecho) if it is not
        supplied with a switch.

        The service_port should normally not be changed.

Note that this version rexec is experimental.  If you give it bad
input it can fail ungracefully.  If you try to do fancy things with
/input, they may not work as expected.  This is a "use at your own
risk" program.

Examples:

        $ rexec/username="jginty" julian "lpq"

This checks the line printer queue on the machine JULIAN and returns a
listing of the jobs currently in the queue.  The command will prompt
for a password before sending the command off.  Note the use of
quotes.  VMS DCL turns all parameters into UPPER CASE unless they are
quoted.  Most UNIX machines are case sensitive so you will usually
have to quote both your user name and the actual command to execute.
The machine names are case insensitive.

        $ rexec/username="jginty"/output=laser.tmp julian "lpq"

This command is similar to the previous command execpt that instead of
the queue listing appearing on your screen, it is placed into the file
LASER.TMP on the VMS machine.  This can be useful if you intend to do
some further processing on the output.

        $ rexec/user="guest"/pass="free" [email-masked] "rn -c"

This sends the command "rn -c" to the machine named [email-masked].  The
command is performed under the guest account on that machine.  The
output of the command would be displayed on your terminal.

Rexec was written and submitted into the public domain by Kevin
Carosso, [email-masked], Innosoft International Inc.

----
Peter Marshall, Data Com. Manager, NSC 220, CCS, Univ. of Western Ontario
519-661-2151  [email-masked]   [email-masked]   [email-masked]