The UNIX and Linux Forums  


Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com



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

 
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #1 (permalink)  
Old 02-13-2006
daneensign daneensign is offline
Registered User
  
 

Join Date: Feb 2006
Posts: 3
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
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 09:02 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0