I think I'm having the same problem. Here is the code:
Code: Select all
(define (remote-script remconnect remscript)
(map set '(inloc outrem) (pipe))
(map set '(inrem outloc) (pipe))
(set 'pid (process remconnect inrem outrem))
(write outloc remscript)
(close outloc)
(close inrem)
(close outrem)
(while (set 'p (peek inloc))
(sleep 500)
(print "peek" p " " (read inloc buf 128) " " buf))
(close inrem)
(destroy pid)
)
An example of what I'm trying to do with it:
Code: Select all
(remote-script "ssh mybox sh" "df -h")
That sample would log into my box and check disk usage.
However, when I do that, it hangs. If I run that from the command line,
It works; it runs the command and exits and returns to shell.
When I use (process) it never detects that the ssh program has ended.
I am using newLisp 10.6.2 on Debian Linux.
This problem happens also if I don't close the pipe ends.
Since I need the output of the command, I'm reluctant to add the extra complexity of spawn/send.
Cavemen in bearskins invaded the ivory towers of Artificial Intelligence. Nine months later, they left with a baby named newLISP. The women of the ivory towers wept and wailed. "Abomination!" they cried.