I need to get the result of a remote ksh into a varible, i will use that variable later for being mailed (but thats another issue).
I must note that the result of the remote script takes like 15-30 seconds (it executes a query) to be done.
This is the script, the result is a string of only 20-30 chars.
set timeout -1
spawn ssh -tt user2@machine2 data/remote_script.sh >>$VAR
send -- "argos001\r\n"
send -- "\r"