LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
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, 09: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-12-2012, 11:07 PM   #2
towheedm
Member
 
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.
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, 05: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



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 11:54 AM
[SOLVED] Using trap in bash script sree_ec Programming 13 03-28-2012 10:48 PM
how to send snmp trap & recieve trap in C program minil Programming 3 07-10-2010 09:22 AM
Shell script trap and log out a user fmcauley Programming 6 03-06-2007 10:10 PM
shell script - trap program termination dnijaguar Linux - Software 0 07-19-2003 12:27 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

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

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
Open Source Consulting | Domain Registration