Help with Ping command.

Hi,

I have a shell script, that has to run in putty for days together. So , I need to keep the network server connection alive and running. The execution of shell script shouldn't be interrupted as it produces undesirable results.

Can anyone provide me with a script ?

You can send it into the background with

nohup ./myping.sh &

and log off and see what it did. If you don't redirect it's output inside the script, you will have to use something like

nohup ./myping.sh >> myping.log 2>&1 &

You can log off and it will go on. Don't forget to set either the interval a bit higher than every second or/and maybe have a extra file system or very large one to avoid coliding with vital file systems in terms of space issues.

nohup yourscript.sh &

this will put your script in background and keep running it even if you log off from your terminal

nohup is probably the correct answer here, another option is to use screen on the server which will allow you to reconnect to the terminal if the network is interrupted (useful if you need to review the output on an ongoing basis.