Hi I have searched various forums and here as well, I could find some answers for Linux and Mac but not able to find solution for Unix and specially Korn Shell.How to get process name (command name) from process id (pid)
Below reference I found from SO This one And this one also.
I think it is easier to use pgrep. For example:
Otherwise, you can do it as follows:
Better way: Let's check the last column ($NF), no matter its number:
If you want to match not exact strings, you can use ~ instead:
* Awk Introduction Tutorial – 7 Awk Print Examples