The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

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




View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #1 (permalink)  
Old 09-29-2006
midhun_u midhun_u is offline
Registered User
  
 

Join Date: Jul 2006
Location: Paris, France
Posts: 8
Run a job in background for infinte time

Hello All,

I would like to know if it is possible to launch a job in background for infinite time.

example:

myScript.ksh
while true
do
( echo "(`date`)"; top -U user | grep 'Memory:' ) >> log &
sleep 1800
done

and when i do myScript.ksh & my log file is just updated for the first time and never again.

but when i do myScript.ksh it works kool.

could someone suggests me pls

tnx