How do I know if a jar is running on Linux?

How do I know if a jar is running on Linux?
Answer
So there are three four cases:
  1. jar is running and grep is in process list -> grep returns 2.
  2. jar is running and grep is not in process list -> grep returns 1.
  3. jar is not running and grep is in process list -> grep returns 1.
  4. jar is not running and grep is not in process list -> grep returns 0.
 

Tìm kiếm

Back
Top