Quantcast
Channel: Active questions tagged expect - Unix & Linux Stack Exchange
Viewing all articles
Browse latest Browse all 157

Send Ctrl+C to script running through ssh

$
0
0

So i got a script that i run through ssh like so:

ssh user@ip <<'EOF'export TERM=xterm#list of commands hereEOF

Problem is, in certain instance, i need to use Ctrl+C in the terminal, mainly when running application such as expect or other that could use prompt or ncurse...

I know i could do something like this:

commandherePID=$!kill -INT $PID

But that wouldn't be right in this case, since i would either need to:

  • use a function (prefer to only use a list of command like above, plus it wouldn't run locally but instead through ssh as far as i know)
  • use this after each command.

How could i send Ctrl+C on the current terminal when running commands through ssh?


Viewing all articles
Browse latest Browse all 157

Trending Articles