Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Enable Control-C interrupt

Status
Not open for further replies.

cardy

Technical User
Sep 5, 2000
33
0
0
GB
Simple question - how do you enable control-c to make it interrupt a program?
 
Hi cardy

Just follow my step by step approach style

step1:check your interrupt key by using the following command.In most of the cases or default is control-C

#stty -a

step2:If your interrupt key is set to default ...it is okay..
or you can change to any key ..eg;

#stty intr ^M

step 3: Now check for new interrupt key
by using stty -a command with flag

But be sure that M or any alphabet should be unique.





sushveer
IBM certified specialist-p-series AIX5L System Administration
AIX/SOLARIS/WEBSPHERE-MQ/TIVOLI Administrator
 
sushveer,

I tried this but it is still not working. No matter what character I use, it won't interrupt my process. I just get the control character displayed e.g. ^C. Other control characters seem to work, e.g. ^Z to suspend the process.

Any other ideas?

Cheers

Cardy
 
Hi cardy
Can you send me the output of stty -a command with flag?for
further problem analysys...?


sushveer
IBM certified specialist-p-series AIX5L System Administration
AIX/SOLARIS/WEBSPHERE-MQ/TIVOLI Administrator
 
On a system where control-C works -
$ stty -a
speed 9600 baud;
rows = 34; columns = 132; ypixels = 446; xpixels = 811;
eucw 1:0:0:0, scrw 1:0:0:0
intr = ^c; quit = ^\; erase = ^h; kill = ^u;
eof = ^d; eol = <undef>; eol2 = <undef>; swtch = <undef>;
start = ^q; stop = ^s; susp = ^z; dsusp = ^y;
rprnt = ^r; flush = ^o; werase = ^w; lnext = ^v;
parenb -parodd cs8 -cstopb hupcl cread -clocal -loblk -crtscts -crtsxoff -parext
-ignbrk -brkint -ignpar -parmrk -inpck -istrip -inlcr -igncr icrnl -iuclc
ixon -ixany -ixoff -imaxbel
isig icanon -xcase echo echoe echok -echonl -noflsh
-tostop echoctl -echoprt echoke -defecho -flusho -pendin iexten
opost -olcuc onlcr -ocrnl -onocr -onlret -ofill -ofdel

On a system where control-C doesn't work -
$ stty -a
speed 9600 baud;
rows = 34; columns = 132; ypixels = 446; xpixels = 811;
eucw 1:0:0:0, scrw 1:0:0:0
intr = ^c; quit = ^\; erase = ^h; kill = ^u;
eof = ^d; eol = <undef>; eol2 = <undef>; swtch = <undef>;
start = ^q; stop = ^s; susp = ^z; dsusp = ^y;
rprnt = ^r; flush = ^o; werase = ^w; lnext = ^v;
parenb -parodd cs8 -cstopb hupcl cread -clocal -loblk -crtscts -crtsxoff -parext
-ignbrk -brkint -ignpar -parmrk -inpck -istrip -inlcr -igncr icrnl -iuclc
ixon -ixany -ixoff -imaxbel
isig icanon -xcase echo echoe echok -echonl -noflsh
-tostop echoctl -echoprt echoke -defecho -flusho -pendin iexten
opost -olcuc onlcr -ocrnl -onocr -onlret -ofill -ofdel

As far as I can tell, these outputs are the same!!
 
Hi,
We have exactly the same problem on a recent SCO 5.0.6 system. No matter what shell you use nor which interrupt character, the interrupt key does not work.
I have submitted the problem to SCO but haven't had an answer yet. I guess one of the os supplements changed that behaviour, since 5.0.5 works very fine.

This problem is very annoing and we hope a solution will be found quickly.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top