c program the catches the ctrl-c(SIGINT) Signal for the
first time and prints a output rather and exit on pressing
Ctrl-C again
Answers were Sorted based on User's Feedback
Answer / rakesh
#include <stdio.h>
#include <signal.h>
void sigproc(void);
main()
{
signal(SIGINT, sigproc);
printf("This program catches ctrl-c(SIGINT) signal for
first time and exit on pressing ctrl-c again\n");
for(;;);
/* infinite loop */
}
void sigproc()
{
signal(SIGINT, sigproc);
printf("you have pressed ctrl-c \n");
(void) signal(SIGINT,SIG_DFL);
}
| Is This Answer Correct ? | 0 Yes | 0 No |
Is shell script a programming language?
How can I send a mail with a compressed file as an attachment?
how to delete all the files with extension .dat rom a directory tree from root to third level in a single unix command?
How can the contents of a file inside jar be read without extracting in a shell script?
What is the first line of a shell script called?
What is sudo command?
i have 2 tables 4 colums table 1 respective values a1 6, a2 8,a3 9,a4 14 & table 2 respective values a1 6, a2 8, a3 9, a4 12. if compare 2 tables 3 colums values same then 4th column values 1)Qes diff >5 then (5 * diff value ) 2)Qes diff <5 the 5 3)Qes diff 5 then 5 print respective values..
Is powershell a bash?
What does it mean by #!/Bin/sh or #!/Bin/bash at the beginning of every script?
How many prompts are available in a UNIX system?
What is basename in shell script?
Where are cowrie shells found?