Newsgroups: comp.parallel.pvm
From: eddemain@neumann.uwaterloo.ca (Erik Demaine)
Subject: Re: pvm command line arguments
Organization: University of Waterloo
Date: Sat, 29 Jun 1996 13:54:10 GMT
Message-ID: <DtrLAA.EvC@undergrad.math.uwaterloo.ca>

Boyana Norris (radenska@cs.uiuc.edu) wrote:
: Is there any way to specify pvm commands when pvm is started from 
: the Unix shell (other than a hosts file)?  The reason for this 
: question is that I would like to write a little script to go to 
: the pvm console, issue a halt command, then start pvm and quit 
: (leaving the pvm daemon active). 

Try expect, which is based on Tcl.  It allows automatic communication with
interactive programs.  Do a websearch on expect to find it.  You could say
something like:

#!/usr/local/bin/expect
spawn pvm
expect {pvm>}
send "halt\n"
send "quit\n"
wait
spawn pvm
expect {pvm>}
send "quit\n"
wait

It's a very useful utility.
Erik
--
Erik Demaine                 \/  e-mail: eddemain@neumann.uwaterloo.ca
Dept. of Computer Science    /\  URL   : http://barrow.uwaterloo.ca/~eddemain/
University of Waterloo       \/  Most jugglers do poorly while drunk, especially
Waterloo, ON Canada N2L 3G1  /\  in a large wavelength gravity field.

