- How can I tell if given process is alive?
How can I tell if given process is alive?
Use the -p option of ps like this:
MYPID=1234 if ps -p $MYPID >/dev/null; then echo alive else echo not-alive fi
I read about this in Linux Journal.
Copyright © 2008-2020, dave Code samples on Dave's Brain is licensed under the
Creative Commons Attribution 2.5 License.
other material, including English text has all rights reserved.