LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
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!

Notices


Reply
  Search this Thread
Old 07-12-2012, 10:10 PM   #1
workout74
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
towheedm
Member
 
Registered: Sep 2011
Location: Trinidad & Tobago
Distribution: Debian Jessie
Posts: 592

Rep: Reputation: 119Reputation: 119
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.
http://linuxcommand.org/wss0150.php
http://tldp.org/LDP/Bash-Beginners-G...ect_12_02.html

Hope it helps.
 
1 members found this post helpful.
Old 07-13-2012, 06:45 AM   #3
workout74
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
 
  


Reply


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


All times are GMT -5. The time now is 04:58 AM.

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