LinuxQuestions.org
Review your favorite Linux distribution.
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-20-2008, 04:33 PM   #1
stympman
LQ Newbie
 
Registered: Oct 2008
Posts: 16

Rep: Reputation: 0
need help on bash scripting


I have two things that I can't figure out.

1. How to a get a bash script to print out only it's own PID

2. How do I send a signal to a running script. More specifically signal SIGHUP(1), SIGINT(2) and SIGTERM(15)

Thanks
 
Old 10-20-2008, 04:43 PM   #2
BlueC
Member
 
Registered: Aug 2007
Posts: 122

Rep: Reputation: 17
Quote:
Originally Posted by stympman View Post
2. How do I send a signal to a running script. More specifically signal SIGHUP(1), SIGINT(2) and SIGTERM(15)
kill -HUP pid
kill -INT pid
kill -TERM pid
 
Old 10-20-2008, 04:49 PM   #3
BlueC
Member
 
Registered: Aug 2007
Posts: 122

Rep: Reputation: 17
Quote:
Originally Posted by stympman View Post
1. How to a get a bash script to print out only it's own PID
Apparently $$ contains the pid of the current script and $! contains the pid of the last background process started from within the script.

HTH
C
 
Old 10-20-2008, 06:20 PM   #4
onebuck
Moderator
 
Registered: Jan 2005
Location: Central Florida 20 minutes from Disney World
Distribution: SlackwareŽ
Posts: 13,925
Blog Entries: 44

Rep: Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159
Hi,

Sounds like homework to me!
 
  


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
Help with bash scripting amishtechie Programming 5 09-28-2008 04:59 AM
bash scripting stu_mueller Slackware 4 04-15-2008 02:09 PM
Bash Scripting Help Aioth Linux - Newbie 8 09-21-2004 11:21 AM
Bash scripting JonCooperUK Programming 3 03-04-2004 08:55 PM
bash scripting -=MaGo=- Programming 16 08-30-2003 07:07 PM

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

All times are GMT -5. The time now is 03:08 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
Open Source Consulting | Domain Registration