[mdlug] Remote shell scripts via ssh?

Ingles, Raymond Raymond.Ingles at compuware.com
Wed Feb 28 15:45:09 EST 2007


> From: Aaron Kulkis

> I would make that a wrapper script, call it, say, remssh

> ssh $USER_REMOTE_HOST /bin/sh << $SCRIPT

 That works, except for a minor problem... command-line arguments. Fortunately,
reading a man page or two, and adapting some of Greg's suggestion, the following
seems to work to pass arguments to the script running remotely:

 ssh user at host "/bin/sh -s Arg1 Arg2 Arg3" < localscript.sh

 Seems to work pretty well so far.

 Sincerely,

 Ray Ingles                                                     (313) 227-2317

 "There is no distinction in nature between microevolution and macroevolution.
 Macroevolution is just larger quantities of macroevolution over much longer
 times. It's like saying that there's 'microwalking' which is what I do from
 the car park to the office every morning, and down to the shops on weekends,
 and that can result in changes of my location over time on a small scale; but
 the idea that people, over tens of thousands of years walked out of central
 Africa into Europe, then over to Asia, across to North America and into South
 America - that's 'macrowalking' and it's impossible. God must have put them
                        there." - Anthony Steele
The contents of this e-mail are intended for the named addressee only. It contains information that may be confidential. Unless you are the named addressee or an authorized designee, you may not copy or use it, or disclose it to anyone else. If you received it in error please notify us immediately and then destroy it. 



More information about the mdlug mailing list