![]() |
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| suspend a process | superuser84 | UNIX for Advanced & Expert Users | 6 | 03-18-2008 09:36 PM |
| need help: shell script to restart apache when no. of processes keeps growing | _joshua_ | Shell Programming and Scripting | 14 | 03-07-2007 08:06 AM |
| need help to write script to check the process health and automatically restart it | dragondad | Shell Programming and Scripting | 1 | 10-31-2006 06:16 PM |
| suspend a process | piou78 | Shell Programming and Scripting | 7 | 06-03-2005 10:08 AM |
| UNIX Process Suspend | proton | UNIX for Dummies Questions & Answers | 3 | 02-13-2005 03:27 AM |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
suspend/restart a process in shell script
Hi,
I have a task that Im stuck on. I have an elementary script named 'myscript' that prints "the script is running" once a second. It runs for 27 seconds. I need to write a 2nd script that starts 'myscript' and takes a parameter '$1' for a number. my 2nd script then needs to pause myscript every $1 seconds for $1 seconds until myscript completes. myscript should not be 'aware' or 'listen' for anything. I tried the wait command but it starts over instead of picking up where it left off. I looked at setting myscript as a background process, but again that doesnt seem like the solution as it wouldn't pause. Please can someone explain what commands/approach they would use to solve my problem? My only other thought would be to grep the process from ps as a looping condition, if it exists then put it to sleep (I dont think I can use the sleep command in this way though..?). Thank you in advance for any help you can offer my noob self. Best regards, Dane Ensign |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|