tru64-unix-managers (formerly alpha-osf-managers) (1994-2012)
 help / color / mirror / Atom feed
From: Burch Seymour RTPS <bseymour () ns ! encore ! com>
To: tru64-unix-managers
Subject: Shell strangeness and kill by name
Date: Thu, 23 Jul 1998 17:40:57 +0000	[thread overview]
Message-ID: <96078715811891.tru64-unix-managers.marc@archive.invalid> (raw)


Perhaps there's a better way to do this, but I thought I had developed
an answer, even if a bit crude. The problem: I'm moving and app to
DU which used to run on an OS that dealt very well with processes by name.
So, I need a way to kill processes by name. If there is an interface that
does that, I'm missing it (suggestions appreciated). 

So, I came up with a ps and grep solution, but it acts strangely, working
one day and not the next and I'm not seeing the problem. For example:

   get all processes, grep for the one I want, minus the grep proc and
   cut only the pid. This would be enclosed in a kill `<cmd>` thing
   to actually do the deed. However, it returns nothing!

pacer> ps -ef | grep csci2_t2 | grep -v grep | cut -f 3 -d ' ' 

pacer>

   Now if I run just the ps and grep parts I see there *is* a
   process out there:

pacer> ps -ef | grep csci2_t2 | grep -v grep
bseymour 13014     1  0.6 13:27:19 ttyp1        0:00.14 [csci2_t2]

   And, if I take the output from the ps and greps and run it through
   the cut command, I get the parent process ID. 

pacer> echo bseymour 13014     1  0.6 13:27:19 | cut -f 3 -d ' '
1
pacer> 

I'm baffled as to why doing this as two commands works, but as one
does not. Do any of you see what it is that I am missing?

And again, is there a better way to kill processes by name?

Mucho thanxo.

-- 
This message from,		Encore Computer Corporation   MS/108
Burch Seymour                   6901 W Sunrise Boulevard
Senior Software Engineer	Fort Lauderdale, Fl 33313 
email: bseymour@encore.com      Vox: (954)316-4480   Fax: (954)316-4454

                 reply	other threads:[~1998-07-23 17:40 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed
read-only archive

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox