Is it possible??


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Is it possible??
# 1  
Old 08-22-2008
Is it possible??

I have following script..
Quote:
while :
do
date
done
which print date on screen continuously..
i start it on command line..
once its started it will go on...

IS THERE ANY WAY TO SEND TO TO BACKGROUND ONCE ITS STARTED???

thanks,
vidya...
# 2  
Old 08-22-2008
Because you have the date command which wants to write to stdout, without redirecting the date command you will get a SIGTTOU.

What are you trying to do? make some kind TSR program that shows time?
# 3  
Old 08-22-2008
You can cheat and create a screen (GNU screen) before starting the script and then detaching from the screen: Ctrl-A, d.
# 4  
Old 08-22-2008
You also really should put a "sleep 1" in the loop, as executing the date program non-stop like that will eat up your CPU cycles like crazy.

No point in printing the time zillions of times every second.

If all you want is a digital display of the current time, consider using xclock like so: xclock -digital -update 1 &
# 5  
Old 08-23-2008
guys guys..
it was just a example..
Quote:
my question is is it possible to move a running script to backend??
# 6  
Old 08-23-2008
yes, its definitely possible

switching process between background and foreground is definitely possible
# 7  
Old 08-23-2008
Quote:
Originally Posted by matrixmadhan
yes, its definitely possible

switching process between background and foreground is definitely possible
how??
Login or Register to Ask a Question

Previous Thread | Next Thread
Login or Register to Ask a Question