- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- script needed
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
11-06-2002 03:37 PM
11-06-2002 03:37 PM
script needed
I am using the below script to swtich to another id and run a script.
.....
(sleep 2
echo /home/users/reset.sh
sleep 20
echo exit) | sw rkat
......
What the above script does is switch to user rkat and execute reset.sh script.
My problem the reset.sh will terminated after 20 second or depend on the value that assign to sleep. I am hoping the above code will run reset.sh until finish and sleep for 20 second and exit not to exit after 20 second while reset.sh is still running. Since the time taken to run reset.sh can not be determined in advance and I am not able to run the above script (reset.sh) to finish.
Any idea to get around with the problem?
I have tried to use & but still it doesn't help
(sleep 2
echo "/home/users/reset.sh &"
sleep 20
echo exit) | sw rkat
Thanks.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-06-2002 04:00 PM
11-06-2002 04:00 PM
Re: script needed
You simply need to use wait , instead of sleep. This will wait for process to finish before cotinuing with next task
HTH
Steve
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-06-2002 04:42 PM
11-06-2002 04:42 PM
Re: script needed
I have tried you suggestion to use wait instead, somehow it still doesn't work. Probably I didn't do it right. Here is what I did
sleep 2
echo "/home/users/reset.sh &"
wait
echo exit) | sw rkat
By doing this the script exit immediately.
Please advised
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-06-2002 05:10 PM
11-06-2002 05:10 PM
Re: script needed
I have no idea what this script does or whether it *needs* to run in the background - but you ought to ba able to do the following:
su rkat -c "/home/users/reset.sh ; exit"
This will run the script as the rkat user & the exit will not occur until the script returns.
The problem with the wait command is that it needs to work on a PID.
HTH,
Jeff
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-06-2002 08:46 PM
11-06-2002 08:46 PM
Re: script needed
su -