Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do I use ssh to run a program?

Status
Not open for further replies.

HydroBob

Technical User
Feb 28, 2002
12
0
0
US
I am trying to use ssh to run a program and do not know how to do it. What I am trying to accomplish is to print output from myprogram as it is being posted rather than all at once after myprogram completes. I have this working without the 'exec ssh lx1' portion, but need to be able to access lx1 where myprogram resides.

A snippet of my code is:

set command "exec ssh lx1 /mydir/myprogram $myvariable"

if [catch {open "|$command|&cat"} input]{
$log insert end $input\n
} else {
fileevent $input readable Log
}

Thanks in advance,
Bob
 
Did you tried //lx1? (this is the standart addressing syntax for a net node)

Code:
set command "exec ssh //lx1 /mydir/myprogram $myvariable"

HTH

ulis
 
Thanks for the suggestion. I solved the problem by running the script on the machine I was trying to ssh to. Made things much easier in the long run.

Bob
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top