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 |
What are the different types of variables used in shell script?
How do you schedule a command to run at 4:00 every morning?
Is shell scripting difficult?
How do I stop script errors?
How do scripts work?
What is the conditional statement in shell scripting?
What is batch file programming?
how to read systems current date and time
Determine the output of the following command: [ -z “” ] && echo 0 || echo 1
What does debug script mean?
What is the basic difference you find between a shell script and perl?
Tell something about the super block in shell scripting?