03-21-2012
ctrl+c not working
Hi All,
I have ran one command tail -f <filename> to view newly appended text to that file. When i was done i pressed ctrl+c command to stop it but to my suprise it didn't work. I then tried top command and pressed ctrl+c and it worked fine and command aborted.
I then just checked the tail process entry in /proc directory. One of the entry was showing as SigIgn: 0000000000000002 and for top command (before aborting i checked) it was showing as SigIgn: 0000000000000000
Are these entries the root cause for ctrl+c not working? Or can someone please explain these entries? Thanks.
Regards,
Tushar Shah
10 More Discussions You Might Find Interesting
1. AIX
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
2. Shell Programming and Scripting
Hi there,
I'm using HP-UX 11 machine. I am running a script, thats gonna take a long time to execute. When I press ctrl-c to come out of my script, I have to catch that signal(ctrl-c) and display that ctrl-c had been pressed. How can I do it.
Thanks in advance (2 Replies)
Discussion started by: sendhilmani123
2 Replies
3. UNIX for Dummies Questions & Answers
Hi
My CTRL/C does not work thought the STTY setting looks Ok
Appreciate your assistance
$stty -a
speed 38400 baud;
rows = 24; columns = 80; ypixels = 0; xpixels = 0;
eucw 1:0:0:0, scrw 1:0:0:0
intr = ^c; quit = ^\; erase = ^?; kill = ^u;
eof = ^d; eol = <undef>; eol2 = <undef>;... (10 Replies)
Discussion started by: zam
10 Replies
4. Programming
Hello,
I am programming some kind of shell in special distribution of Linux. My trouble comes with programming the sort function. It should work the same like in the standard shell. When you terminate input, there's need to put End Of Transmission character, which is CTRL+D. But I am not able to... (2 Replies)
Discussion started by: samciz
2 Replies
5. Shell Programming and Scripting
H! I have written script where it need to invoke the perl script in background, then write the pid in temp file then bring back the job to foreground. whenever the Ctrl-C or Ctrl-Z is pressed in the script has to exit and prompt should be dispalyed. but this script causing exit from shell session... (2 Replies)
Discussion started by: jramesh1
2 Replies
6. Shell Programming and Scripting
Hi All,
Although each line below seems to work by itself, I've been having trouble getting the Control-C trap working when I add the "|perl -pe..." to the end of the tail -f line, below.
(That |perl -pe statement basically just adds color to highlight the word "ERROR" while tailing a log... (2 Replies)
Discussion started by: chatguy
2 Replies
7. Shell Programming and Scripting
how to send ctrl-c signal in scripts ???
i am executing top command in .exp script
top command gives cpu running activities on your machine
eg
# top
top - 18:41:01 up 8:38, 5 users, load average: 0.03, 0.16, 0.16
Tasks: 172 total, 1 running, 170 sleeping, 0 stopped, 1 zombie... (3 Replies)
Discussion started by: alexzander18
3 Replies
8. Shell Programming and Scripting
Hi,
while executing shell script, in the middle of the process, if we kill the shell script( ctrl+z or ctrl+c), script will be killed and the files which using for the script will be in the folder.
How to handle those scenarios. Is there any possibilities, if user breaks the script, I need to... (3 Replies)
Discussion started by: ckchelladurai
3 Replies
9. UNIX for Dummies Questions & Answers
Hi friends,
I am trying to add a newline char ('\n') between the query and the commit statement in the following shell script.
#! /bin/sh
echo "select * from tab; commit;" > data.sql
I have tried typing in "Ctrl-V + Ctrl-J" combination which has inserted ^@ (NUL) character but the commit... (1 Reply)
Discussion started by: royalibrahim
1 Replies
10. Shell Programming and Scripting
Hi..!
I'm stuck with my automation of starting a process and keeping it running even after the current ssh session has exited..
So i'm trying to use command 'screen'. which is doing exactly what i wanted, But the problem is automation of the same.
i will have to press Ctrl+a and Ctrl+d for... (2 Replies)
Discussion started by: chandana hs
2 Replies
LEARN ABOUT CENTOS
readkey
readkey(3alleg4) Allegro manual readkey(3alleg4)
NAME
readkey - Returns the next character from the keyboard buffer. Allegro game programming library.
SYNOPSIS
#include <allegro.h>
int readkey();
DESCRIPTION
Returns the next character from the keyboard buffer, in ASCII format. If the buffer is empty, it waits until a key is pressed. You can see
if there are queued keypresses with keypressed().
The low byte of the return value contains the ASCII code of the key, and the high byte the scancode. The scancode remains the same whatever
the state of the shift, ctrl and alt keys, while the ASCII code is affected by shift and ctrl in the normal way (shift changes case,
ctrl+letter gives the position of that letter in the alphabet, eg. ctrl+A = 1, ctrl+B = 2, etc). Pressing alt+key returns only the scan-
code, with a zero ASCII code in the low byte. For example:
int val;
...
val = readkey();
if ((val & 0xff) == 'd') /* by ASCII code */
allegro_message("You pressed 'd'
");
if ((val >> 8) == KEY_SPACE) /* by scancode */
allegro_message("You pressed Space
");
if ((val & 0xff) == 3) /* ctrl+letter */
allegro_message("You pressed Control+C
");
if (val == (KEY_X << 8)) /* alt+letter */
allegro_message("You pressed Alt+X
");
This function cannot return character values greater than 255. If you need to read Unicode input, use ureadkey() instead.
SEE ALSO
install_keyboard(3alleg4), ureadkey(3alleg4), keypressed(3alleg4), clear_keybuf(3alleg4), simulate_keypress(3alleg4)
Allegro version 4.4.2 readkey(3alleg4)