0

I am trying to execute some commands and one of which will not come back to console and need to explicitly bring it using ctrl+ c. After that I need to execute some more commands in that script.

expect "$ "
send "sh /root/jboss-eap-6.3/bin/standalone.sh\r"
set timeout 10

expect "$ "

I have to run other commands after executing standalone.sh script. But it will hold and not come back to console. I tried

trap {
    send \x03
    send_user "You pressed Ctrl+C\n"
} SIGINT

. But that also didn't worked.

Thanks in advance.

Karthik
  • 3
  • 3

1 Answers1

0

There are all sorts of ways to kill a process in bash. If you by some chance know the name of your (jboss eap) process you could run pkill processName, killall processName or kill pidof processName instead of trying to send key-strokes.

Hampus
  • 2,769
  • 1
  • 22
  • 38