running multiple commands via ssh quickly

2000-03-06 Thread Dan Christensen
I have various shell scripts that do something like the following:

if ssh -a -x remote-machine remote-command  local-file
then
  ssh -a -x remote-machine another-command
  local-command
else
  ssh -a -x remote-machine third-command
  another-local-command
fi

and more complicated variations.  The commands in question are
very fast, but the script is slow because ssh needs to authenticate
each time.  (I run ssh-agent and have entered an identity into the
agent before running the script, so no passwords need to be typed.)

What I am looking for is a way to just authenticate once, and then
have the ability to run remote commands getting the error code and
the output on the local machine.

Is there an easy way to do this?

The sort of thing I imagine is running ssh once to forward a local
port to the remote machine, and then somehow sending commands along
the channel and getting the error code and output also on that
channel.  But this seems a bit tricky to set up.

Thanks for any ideas.

Dan

-- 
Dan Christensen
[EMAIL PROTECTED]


Re: running multiple commands via ssh quickly

2000-03-06 Thread Allan M. Wind
On 2000-03-06 16:59:10, Dan Christensen wrote:

 What I am looking for is a way to just authenticate once, and then
 have the ability to run remote commands getting the error code and
 the output on the local machine.
 
 Is there an easy way to do this?

fsh


/Allan
-- 
Allan M. Wind   Finger: [EMAIL PROTECTED] (GPG/PGP)
P.O. Box 2022   Email: [EMAIL PROTECTED]
Woburn, MA 01888-0022   ICQ: 44214251
USA Phone: 781.279.4513