Latest LQ Deal: Latest LQ Deals
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 07-12-2012, 10:10 PM   #1
LQ Newbie
Registered: Jul 2012
Location: Arlington, VA
Posts: 2

Rep: Reputation: Disabled
script to trap SIGNIT

i am trying to execute a script and have it trap SIGNIT and give me a response. does it matter where in the script i place the trap statement? i placed it at the end but nothing happened
Old 07-13-2012, 12:07 AM   #2
Registered: Sep 2011
Location: Trinidad & Tobago
Distribution: Debian Stretch
Posts: 612

Rep: Reputation: 125Reputation: 125
Hopefully you meant SIGINT and not SIGNIT. The signal is trapped only after the trap command is executed. See these links and also the info pages for BASH.

Hope it helps.
1 members found this post helpful.
Old 07-13-2012, 06:45 AM   #3
LQ Newbie
Registered: Jul 2012
Location: Arlington, VA
Posts: 2

Original Poster
Rep: Reputation: Disabled
Yes i mean SIGINT. Was kind of in a hurry, had to go pick up a friend who was returning from deployment. I moved the location of the 'trap' command and it worked. thanks


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Trap a user in a shell script kelso.b Programming 6 04-20-2012 12:54 PM
[SOLVED] Using trap in bash script sree_ec Programming 13 03-28-2012 11:48 PM
how to send snmp trap & recieve trap in C program minil Programming 3 07-10-2010 10:22 AM
Shell script trap and log out a user fmcauley Programming 6 03-06-2007 11:10 PM
shell script - trap program termination dnijaguar Linux - Software 0 07-19-2003 01:27 AM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 08:47 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration