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.
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 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.