LinuxQuestions.org
Visit Jeremy's Blog.
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 10-10-2011, 02:22 PM   #1
Rmurphy
LQ Newbie
 
Registered: Oct 2011
Posts: 6

Rep: Reputation: Disabled
how to modify my file adding a trap for SIGINT and SIGTERM


HELP Please!!!!

I have to modify the following script to add a trap for SIGINT and SIGTERM, save it and run it in the background. I have no clue and searching on the net isn't helping and my book isn't helping.

Here is my code

#!/bin/bash
count=1
echo "start of the program"
while [ $count -le 10 ]
do
echo "Loop #$count"
sleep 10
count=$[ count + 1 ]
done
echo "end of the program"
 
Old 10-10-2011, 03:01 PM   #2
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,358

Rep: Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751
1st hit on google 'bash trap' http://tldp.org/LDP/Bash-Beginners-G...ect_12_02.html

You should bookmark these
http://rute.2038bug.com/index.html.gz
http://tldp.org/LDP/Bash-Beginners-G...tml/index.html
http://www.tldp.org/LDP/abs/html/
 
0 members found this post helpful.
Old 10-10-2011, 03:20 PM   #3
Rmurphy
LQ Newbie
 
Registered: Oct 2011
Posts: 6

Original Poster
Rep: Reputation: Disabled
I have been to those pages except for 1 it gave me a 404 error in the browser. I do not know how to write the command properly for it execute the way it should.
 
Old 10-10-2011, 08:13 PM   #4
grail
LQ Guru
 
Registered: Sep 2009
Location: Perth
Distribution: Manjaro
Posts: 10,006

Rep: Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191
So based on the first link in chrism01's post, what are you confused about?
 
  


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
Modify file name by adding a sequence number turnvinal Programming 6 10-19-2011 10:00 AM
how to send snmp trap & recieve trap in C program minil Programming 3 07-10-2010 09:22 AM
in bash does control-c = SIGINT or SIGTERM? walterbyrd Linux - General 2 05-09-2006 11:01 AM
Linux - Bash - Trap SIGTERM bigdogdan2 Programming 13 07-20-2004 10:54 AM
modify file access & modify timestamps i2itstud Linux - General 1 05-20-2003 03:34 AM

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

All times are GMT -5. The time now is 10:44 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