I am traping a signal SIGINT in one of my script I am writting for my project.
trap sigint_handler SIGINT
I am having signal handler
sigint_handler()
{
# echo caught signal, now quiting....
exit $?
}
So now when the script gets a CTRL+C signal it gets it and exits.
And on terminal it prints this message:
$^Killed by signal 2.
$
I know this message is generated by system. I guess this happens because of some interrupt, I may not be right.
So now I just want that somehow this message should not come on terminal when exiting the script because of that signal.
My expected behavior is that when I press CTRL+C it should not print any message and come out of the script silently as normally happens.
Can anyone tell me or suggest me to what to do to ignore this message. Is there a way to ignore this message.
Thanks.
Alok.Kr.