tru64-unix-managers (formerly alpha-osf-managers) (1994-2012)
 help / color / mirror / Atom feed
* Shell strangeness and kill by name
@ 1998-07-23 17:40 Burch Seymour RTPS
  0 siblings, 0 replies; only message in thread
From: Burch Seymour RTPS @ 1998-07-23 17:40 UTC (permalink / raw)
  To: tru64-unix-managers


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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~1998-07-23 17:40 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1998-07-23 17:40 Shell strangeness and kill by name Burch Seymour RTPS

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