LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   ignore the TSTP signal (https://www.linuxquestions.org/questions/linux-newbie-8/ignore-the-tstp-signal-4175494677/)

mohitbadgaiyan 02-12-2014 01:04 PM

ignore the TSTP signal
 
how to ignore the TSTP signal in script so that Ctrl-Z deactivate on the script.

Tried below
sigtstp()
{
echo "SIGTSTP received" > /dev/tty
trap - TSTP
echo "SIGTSTP standard handling restored"
}

trap - sigtstp

using above if i Ctrl-Z, it stops the script (without prompt hanging),as without above lines ctrl-Z was hanging prompt
but i want the script should not even stop and the signal should ignored compeletly.


Tried these as well but no luck (prompt hangs)
trap : TSTP # ignore Ctrl-Z requests
trap - TSTP # allow Ctrl-Z requests

please suggest


All times are GMT -5. The time now is 09:24 PM.