parallel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: CTRL-C does not kill remote jobs


From: Ole Tange
Subject: Re: CTRL-C does not kill remote jobs
Date: Mon, 8 Apr 2013 17:23:25 +0200

This is a hard nut to crack. The below should result in 'echo foo |
wc' on the server localhost.

$ echo foo | uuencode input | ssh -tt -oLogLevel=quiet localhost "stty
isig -echoctl -echo ; uudecode -o - | wc |  uuencode output" |
uudecode -o -

But instead it prints 'foo'.

It is easier to see why, when you remove the last uudecode:

$ echo foo | uuencode input | ssh -tt -oLogLevel=quiet localhost "stty
isig -echoctl -echo ; uudecode -o - | wc |  uuencode output"


So it seems the final uudecode gets both a copy of the input and the
output. That does not happen, if the input is delayed:

$ (sleep 1; echo foo) | uuencode input | ssh -tt -oLogLevel=quiet
localhost "stty isig -echoctl -echo ; uudecode -o - | wc |  uuencode
output"

I believe the reason is that the 'stty -echo' takes time to complete,
and before it has completed, all input will be echoed back (as seen in
the first scenario).

As logging in can take an arbitrary amount of time, 'sleep 1' is
simply not good enough.

Can I somehow tell ssh I want a terminal with '-echo' before logging in?

Any stty/ssh experts out there?


/Ole

Attachment: input
Description: Binary data

Attachment: output
Description: Binary data

Attachment: output
Description: Binary data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]