i am new to unix. please give the script
my script need to check a process running or not and if process is not running, script has to start that process.
assuming process as simple java program.
I would be careful when you "grep" for just for java. It may return other processes that use java.
Also when you execute the command 'grep java'. The actual command 'grep java' will show up in the process status queue.
One suggestion is to grep for the script that will execute the java program. This will only work if the script blocks while the java program program is running.
The secret of how to be miserable is to constantly expect things are going to happen the way that they are "supposed" to happen.
You can have faith, which carries the understanding that you may be disappointed. Then there's being a willfully-blind idiot, which virtually guarantees it.