How to send Ctrl Break combination in Expect


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting How to send Ctrl Break combination in Expect
# 1  
Old 01-20-2010
How to send Ctrl Break combination in Expect

Greetings,

I am writing an Expect script to automate multiple processes on an HP-UX system. Everything has gone fine so far but I now have run into a problem. One of the processes that I'm trying to automate requires the key combination of ctrl break and I have so far been unable to figure out how to send it. What would the best way to accomplish this be? Here's the code snippet of the last thing that I tried:

Code:
expect {
 timeout {
  system $EmailCommand
  sleep 360000
 }
 ">" {
  send -b
 }
}


Last edited by DukeNuke2; 01-20-2010 at 06:03 PM.. Reason: please use code tags
# 2  
Old 01-21-2010
Your control break selection will be mapped to a specific character or character sequence by the terminal handler to send to the remote device. You simply need to determine exactly what ASCII character(s) are being sent and replicate it on your expect send line.

You may be able to determine the sequence by turning on expect logging and going into expect interactive mode, so what you type is logged.

Hope that helps.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Expect command to send the user input enter or ctrl+c

Hey All, I am writing one script using expect, that script which is used in spawn will accepts only 1. Enter 2. Ctrl+c Press Control-C to exit, Enter to proceed. Could some one share some thoughts to send the above user inputs in linux expect block ? Thanks, Sam (0 Replies)
Discussion started by: SCHITIMA
0 Replies

2. Shell Programming and Scripting

Send ctrl-C signal using bash script.

declare -a array=( "LLC-load-misses" "LLC-loads" "LLC-store-misses" "LLC-stores" "branch-load-misses" "branch-loads" "dTLB-load-misses" "dTLB-loads" "dTLB-store-misses" "dTLB-stores" "iTLB-load-misses" "iTLB-loads" "branch-instructions" "branch-misses" "bus-cycles" "cache-misses" "cache-references"... (2 Replies)
Discussion started by: BHASKAR JUPUDI
2 Replies

3. Shell Programming and Scripting

Expect/Send

Hello Team, Am trying to write a script for installing PAM in mulitiple server by using expect and send command. Am facing the below issues,could you please assist. thanks. # cat /tmp/gkscrpt.exp #!/usr/bin/expect -d spawn /tmp/agent/install_pam.sh expect -re "(y/n) " send --... (1 Reply)
Discussion started by: gowthamakanthan
1 Replies

4. Shell Programming and Scripting

Vi : Is it possible to send ctrl + d signal from a file made with vi and executing it.

Hi Experts, Is it possible to send ctrl + d signal from a inside a file made with vi, using Ctrl V , Esc and 004 , escape sequence. Since : 004 should exit the script if executed. Is this something possible. I am trying with vi , I put this code ^ , and trying to execute it but... (4 Replies)
Discussion started by: rveri
4 Replies

5. AIX

Send ctrl+C in expect script

Hi, Am trying to transfer file via FTP using expect script from server to client i need to interrupt the file transfer between server and client Please help what should used in expect code.. I used send "ctrl+c\r" expect "Aborted" but that didnt work.. I need what should... (3 Replies)
Discussion started by: Priya Amaresh
3 Replies

6. Programming

Do you know whether ncurses supports Alt or Ctrl combination keys

I'm new in ncurses. I'd like to ask one question. Do you know whether ncurses supports Alt or Ctrl combination keys? Our application wants to get response when inputting Alt or Ctrl combination keys by keyboard in one linux c project. I try one testing on ncurses, it seems ncurses doesn't... (3 Replies)
Discussion started by: liuyan03
3 Replies

7. Solaris

send break

Does anyone know how to send break on a Blade 100? I'm using a serial cable on my laptop and I can see the system boot up just fine, but I want to send break so i can have it boot from cdrom instead of disk. (3 Replies)
Discussion started by: em23
3 Replies

8. Solaris

How send break in T5220 Box?

Hi, I used "send brk" from terminal in T5220 Box, but no response. Anyone know what's reason? Thanks! (7 Replies)
Discussion started by: xlen
7 Replies

9. Shell Programming and Scripting

Expect Send

Dear All, I wanna write a script in which it expect something and if it gets whats expected then send the command relating to that. for instance Userame: Asad Required Password for Asad: ****** I tried to use the expect key word but its does not work. I am using Solaris 8/9 If... (1 Reply)
Discussion started by: asadlone
1 Replies

10. AIX

Disable ctrl-c,ctrl-d,ctrl-d in ksh script

I wrote a ksh script for Helpdesk. I need to know how to disable ctrl-c,ctrl-z,ctrl-d..... so that helpdesk would not be able to get to system prompt :confused: (6 Replies)
Discussion started by: wtofu
6 Replies
Login or Register to Ask a Question