I am on a Solaris OS and i have come up with a csh script named " mycshscript " which will grab data from a datalog file & format the grabbed data & upload formated version to web server. I would want to have this script to run non-stop so that the latest can be captured since data is always appending to the datalog file. Below is a skeleton of my script using a while loop to loop non-stop.
My question is that
1) Does closing my command console stop the running of my script?
2) If i want to stop my script from running, how am i able to do it in a clean manner?
#!/bin/csh
set num = 1
while ($num == 1)
......
.......
end
1) How do i stop the process if i need to?
2) how do i need to create a while loop for this ?
3) If there's an echo command, will it be printed out ?
4) Do i need to add in the " nohup myprogram & >/dev/null 2>&1 " just like cronjob to remove all the echoing and printing command ?
I dare not experiment with this command as it is very new to me and i hope that the system will not collapse because of this if not everybody will start to scream at me. So i will have to really make sure everything is ok before i try out.
I tried several time before the process can be killed. It will return a " Killed " if successful
The kill command did not return anything at my 1st try.
I tried out serveral time but somehow the process canot be killed during my 1st try.
Yeah indeed the PID and PPID changed to another number!!
But what is the reason for reparenting to the init process (pid=1) ??
Do you mean if i actually perform a non-stop while loop with my csh script, there is a chance where this process cannot be killed?!?
This is very dangerous.
Any other ways to kill the process ?