Summary: Shell strangeness and kill by name

From: Burch Seymour RTPS <bseymour_at_ns.encore.com>
Date: Thu, 23 Jul 1998 14:08:30 -0400 (EDT)

I had asked about why my kill by name command:

kill `ps -ef | grep csci2_t2 | grep -v grep | cut -f 2 -d ' ' `

didn't work as I expected it to. Several people noted that cut is
probably not doing what I expect it to as multiple spaces can be
interpreted as multiple fields. They suggest I use awk instead ala':

kill `ps -e | grep csci2_t2 | grep -v grep | awk '{ print $1}'`

This seems to work better.

I also received a perl script to kill by name. For now, the command
line thing above is more in line with my needs.

Thanks to all who responded:

Ralph Rodriguez
Steven
Mullin, Stephen
David Warren
Nestor Ruiz
and any who's response is still in the queue somewhere...


-- 
This message from,		Encore Computer Corporation   MS/108
Burch Seymour                   6901 W Sunrise Boulevard
Senior Software Engineer	Fort Lauderdale, Fl 33313 
email: bseymour_at_encore.com      Vox: (954)316-4480   Fax: (954)316-4454
Received on Thu Jul 23 1998 - 18:05:41 NZST

This archive was generated by hypermail 2.4.0 : Wed Nov 08 2023 - 11:53:38 NZDT