I want a script to check if a process is up by checking the process's PID and then return a value for when it's running which would be 0. If it isn't running it should give any other value that 0.
OK what happens when you enter these two commands? On my system:
$> if ps -p 99999 >&- ;then echo running; else echo not running; fi
not running
$> if ps -p 1 >&- ;then echo running; else echo not running; fi
running