<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: kill a process by name in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/kill-a-process-by-name/m-p/2416219#M764861</link>
    <description>Hi Bill,&lt;BR /&gt;&lt;BR /&gt;I have attached one of the first scripts I've ever wrote to kill processes. It &lt;BR /&gt;will do a search for the process given as a parameter to the script and ask you &lt;BR /&gt;which one to kill if more than one process matches the search. Please, PLEASE &lt;BR /&gt;don't mind the dirty style :-)&lt;BR /&gt;&lt;BR /&gt;Paul "Jeez this script could destroy my reputation" Heffels&lt;BR /&gt;&lt;BR /&gt;PS Never mind the Dutch comments</description>
    <pubDate>Tue, 23 Nov 1999 15:01:09 GMT</pubDate>
    <dc:creator>Paul Heffels_1</dc:creator>
    <dc:date>1999-11-23T15:01:09Z</dc:date>
    <item>
      <title>kill a process by name</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/kill-a-process-by-name/m-p/2416217#M764859</link>
      <description>I would like to be able to kill processes running on HP-UX 10.2.x by &lt;BR /&gt;specifiying the name of the process.  I did this on earlier versions of HP-UX &lt;BR /&gt;by grep'ing the 'ps -ef' listing, stripping out the grep command, cutting the &lt;BR /&gt;PID from the resulting line, then issuing a kill on that PID.  I did a ?wc ?l? &lt;BR /&gt;of the lines, and would kill if at least 1 result was found.  This does not &lt;BR /&gt;seem to work as well as it used to.  The $Count does not always "see" the &lt;BR /&gt;process, even though it *is* running.  Is there a better way to do this?  &lt;BR /&gt;Thanks.</description>
      <pubDate>Tue, 23 Nov 1999 12:16:49 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/kill-a-process-by-name/m-p/2416217#M764859</guid>
      <dc:creator>Bill Booth</dc:creator>
      <dc:date>1999-11-23T12:16:49Z</dc:date>
    </item>
    <item>
      <title>Re: kill a process by name</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/kill-a-process-by-name/m-p/2416218#M764860</link>
      <description>Here's a script called killem that does what you're looking for:&lt;BR /&gt;&lt;BR /&gt;#!/bin/sh&lt;BR /&gt;ps -ef|grep $1|grep -v grep|grep -v killem|&lt;BR /&gt;while read X; do&lt;BR /&gt;  PID=`echo $X|awk '{print $2}'`&lt;BR /&gt;  kill $PID&lt;BR /&gt;done&lt;BR /&gt;&lt;BR /&gt;The script takes one command line arg: the name of the process to look for, and &lt;BR /&gt;kills ALL instances it finds.&lt;BR /&gt;If you change the name of the script, also change the name on the grep line of &lt;BR /&gt;the script. The pipe at the end of that line is not a typo.&lt;BR /&gt;&lt;BR /&gt;Be careful to specify enough of the name to avoid conflicts. You probably don't &lt;BR /&gt;want to do things like "killem sh," which would kill all user shells and &lt;BR /&gt;anything else that matches "sh".&lt;BR /&gt;&lt;BR /&gt;MrNeil</description>
      <pubDate>Tue, 23 Nov 1999 13:05:34 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/kill-a-process-by-name/m-p/2416218#M764860</guid>
      <dc:creator>Neil Gast_1</dc:creator>
      <dc:date>1999-11-23T13:05:34Z</dc:date>
    </item>
    <item>
      <title>Re: kill a process by name</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/kill-a-process-by-name/m-p/2416219#M764861</link>
      <description>Hi Bill,&lt;BR /&gt;&lt;BR /&gt;I have attached one of the first scripts I've ever wrote to kill processes. It &lt;BR /&gt;will do a search for the process given as a parameter to the script and ask you &lt;BR /&gt;which one to kill if more than one process matches the search. Please, PLEASE &lt;BR /&gt;don't mind the dirty style :-)&lt;BR /&gt;&lt;BR /&gt;Paul "Jeez this script could destroy my reputation" Heffels&lt;BR /&gt;&lt;BR /&gt;PS Never mind the Dutch comments</description>
      <pubDate>Tue, 23 Nov 1999 15:01:09 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/kill-a-process-by-name/m-p/2416219#M764861</guid>
      <dc:creator>Paul Heffels_1</dc:creator>
      <dc:date>1999-11-23T15:01:09Z</dc:date>
    </item>
  </channel>
</rss>

