From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: <102653641821954.tru64-unix-managers.marc@archive.invalid> From: Kazuro FURUKAWA Date: Mon, 22 Oct 2001 20:56:39 +0000 To: tru64-unix-managers Subject: Finding Process ID X-MARC-Message: https://marc.info/?l=tru64-unix-managers&m=102653641821954 Hi managers, If I want to find a process whose command is "/xxx/abc" distinguishing from "/yyy/abc", I may type ps -o pid,command | grep "/xxx/abc" However, sometimes it fails because ps -o pid,command | grep abc returns "[abc]" instead of "/xxx/abc". What are better ways to deal with it? Do I have to keep pid somewhere when a process starts as many daemons do? Maybe it's the answer. But we already have many programs which should be monitored, and I'd like to find some work-around. I've looked in /sbin/init.d/bin/getpid, but it uses above method. I think scripts in /sbin/init.d which use getpid with full paths may fail easily. ----- Kazuro FURUKAWA Linac, High Energy Accelerator Research Organization (KEK), Japan