request a looping process script
Web Server forum
Back To The Forum Home!Search!Private Messaging System

Web Server Talk Web Server Talk > Unix and Linux reviews > Free Unix support > Unix Programming > request a looping process script




  Last Thread   Next Thread Next
  Show Printable Version Email this Page Subscribe to this Thread      Post New Thread    Post A Reply      

    request a looping process script  
mia456789@yahoo.com.hk


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
02-21-05 12:54 PM

I am not too understand shell script writing , could someone can help
me ,

I want to have a shell script for testing , the process will run
repeatly (looping), I want to test the CPU time , I have the below
script to test :

while x=0
do
cp /tmp/abc.txt /tmp/def.txt
done

the process is non-stop running , but it is not fit my requirement ,
because the above script will generate a new process after the old
process was completed , what I want is a SAME process is running a
non-stop process (same PID ) ,

More clearly , I just want to have a script to run a process ( may be
a looping ) , this process need to use the same PID . In my previous
script , after the cp process finished , it will generate another
process ( so the PID changed ) so not fit my requirement.
could someone can post the script that can do that? thx in advance.





[ Post a follow-up to this message ]



    Re: request a looping process script  
Jens.Toerring@physik.fu-berlin.de


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
02-21-05 11:00 PM

mia456789@yahoo.com.hk wrote:
> I am not too understand shell script writing , could someone can help
> me ,

> I want to have a shell script for testing , the process will run
> repeatly (looping), I want to test the CPU time , I have the below
> script to test :

> while x=0
> do
> cp /tmp/abc.txt /tmp/def.txt
> done

> the process is non-stop running , but it is not fit my requirement ,
> because the above script will generate a new process after the old
> process was completed ,

Yes, of course, what else do you expect? The script can only continue
when the process created for doing the 'cp' is finished and exits.

> what I want is a SAME process is running a non-stop process (same PID ) ,

Forget it. Once the process is dead you can't revive it. And you also
don't have any control over the PID the next process started will get,
if the PID is what you are interested in.

Better explain what exactly you want to do, not how you assume you
can achieve it.
Regards, Jens
--
\   Jens Thoms Toerring  ___  Jens.Toerring@physik.fu-berlin.de
\__________________________  http://www.toerring.de





[ Post a follow-up to this message ]



    Sponsored Links  




 





   All times are GMT. The time now is 09:25 AM.      Post New Thread    Post A Reply      
  Last Thread   Next Thread Next


Most Popular forums 

Forum Jump:
Rate This Thread:

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is OFF
vB code is ON
Smilies are ON
[IMG] code is OFF
 
Medical and Health forum | Computer Games Reviews | Graphics design forum

Back To The Top
Home | Usercp | Faq | Register