- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Script that kill itself
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-06-2002 10:36 AM
05-06-2002 10:36 AM
Is there a way to create a script1 that call another one ( script2 ) and after 20 seconds kill both ?
Tks..
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-06-2002 10:41 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-06-2002 10:44 AM
05-06-2002 10:44 AM
Re: Script that kill itself
#!/usr/bin/sh
/home/user/script2 &
sleep 20
pid_var=`ps -ef | grep script2 | grep -v grep | awk '{print $2}'`
kill -9 $pid_var
Richard
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-06-2002 10:54 AM
05-06-2002 10:54 AM
Re: Script that kill itself
try this
#!/usr/bin/ksh
/home/script1
/home/script2
A= `ps -ef | grep script1 | grep -v grep | awk '{print $1}'
B= `ps -ef | grep script2 | grep -v grep | awk'{print $1}'
C==`ps -ef | grep script1 | grep -v grep | awk '{print $2}'
sleep 20
kill -9 $A $B $C
and this should be good to go.
Manoj Srivastava
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-06-2002 10:56 AM
05-06-2002 10:56 AM
Re: Script that kill itself
Just as another way to do this using a Perl signal handler (among other more traditional methods), please see this thread:
http://forums.itrc.hp.com/cm/QuestionAnswer/1,,0x2c4daf48a9e5d5118ff40090279cd0f9,00.html
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-06-2002 01:31 PM
05-06-2002 01:31 PM
Re: Script that kill itself
Thank to all for the help...