<?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: Killing a process witha script PART 2 in Operating System - Linux</title>
    <link>https://community.hpe.com/t5/operating-system-linux/killing-a-process-witha-script-part-2/m-p/4962018#M101210</link>
    <description>If you are using ps -ef then try negate with grep -v grep when using grep with it.&lt;BR /&gt;&lt;BR /&gt;Simply,&lt;BR /&gt;&lt;BR /&gt;PID=$(ps -ef | gre[ &amp;lt;[P]rocess&amp;gt; | grep -v grep | awk '{ print $2; })&lt;BR /&gt;&lt;BR /&gt;However, It is not always useful. Try to use UNIX95 format. That is good.&lt;BR /&gt;&lt;BR /&gt;--&lt;BR /&gt;Muthu</description>
    <pubDate>Wed, 22 Feb 2006 23:41:14 GMT</pubDate>
    <dc:creator>Muthukumar_5</dc:creator>
    <dc:date>2006-02-22T23:41:14Z</dc:date>
    <item>
      <title>Killing a process witha script PART 2</title>
      <link>https://community.hpe.com/t5/operating-system-linux/killing-a-process-witha-script-part-2/m-p/4962016#M101208</link>
      <description>Hey guys,&lt;BR /&gt;&lt;BR /&gt;I'm using the suggestion from my previous post...&lt;BR /&gt;&lt;BR /&gt;PID=(ps -ef|grep &amp;lt;[P]rocess&amp;gt; | awk '{print $2}')&lt;BR /&gt;&lt;BR /&gt;to get the PID of a process that is running so I can execute a kill on it.  This seemed to work the first time I ran it.  Now I am getting a set of 3 numbers in my return, such as "12345 67890 09877".  How can I correct this?  Thanks.</description>
      <pubDate>Wed, 22 Feb 2006 20:14:57 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/killing-a-process-witha-script-part-2/m-p/4962016#M101208</guid>
      <dc:creator>TheJuiceman</dc:creator>
      <dc:date>2006-02-22T20:14:57Z</dc:date>
    </item>
    <item>
      <title>Re: Killing a process witha script PART 2</title>
      <link>https://community.hpe.com/t5/operating-system-linux/killing-a-process-witha-script-part-2/m-p/4962017#M101209</link>
      <description>Try NEVER to use grep and ps together! ps has many, many options and one of them eliminates the need for grep completely when you are looking for a specific process. Use the -C option to find exactly the process you are looking for:&lt;BR /&gt; &lt;BR /&gt;UNIX95=1 ps -C &lt;PROCESS_NAME&gt; -o pid=&lt;BR /&gt; &lt;BR /&gt;Now the above eliminates both grep and awk because ps can provide all you need. As far as having multiple PID's returned, with the above examp[le, it means that there are multiple copies of the program running. To see them in detail, just change -o pid to -f.&lt;/PROCESS_NAME&gt;</description>
      <pubDate>Wed, 22 Feb 2006 20:46:11 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/killing-a-process-witha-script-part-2/m-p/4962017#M101209</guid>
      <dc:creator>Bill Hassell</dc:creator>
      <dc:date>2006-02-22T20:46:11Z</dc:date>
    </item>
    <item>
      <title>Re: Killing a process witha script PART 2</title>
      <link>https://community.hpe.com/t5/operating-system-linux/killing-a-process-witha-script-part-2/m-p/4962018#M101210</link>
      <description>If you are using ps -ef then try negate with grep -v grep when using grep with it.&lt;BR /&gt;&lt;BR /&gt;Simply,&lt;BR /&gt;&lt;BR /&gt;PID=$(ps -ef | gre[ &amp;lt;[P]rocess&amp;gt; | grep -v grep | awk '{ print $2; })&lt;BR /&gt;&lt;BR /&gt;However, It is not always useful. Try to use UNIX95 format. That is good.&lt;BR /&gt;&lt;BR /&gt;--&lt;BR /&gt;Muthu</description>
      <pubDate>Wed, 22 Feb 2006 23:41:14 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/killing-a-process-witha-script-part-2/m-p/4962018#M101210</guid>
      <dc:creator>Muthukumar_5</dc:creator>
      <dc:date>2006-02-22T23:41:14Z</dc:date>
    </item>
    <item>
      <title>Re: Killing a process witha script PART 2</title>
      <link>https://community.hpe.com/t5/operating-system-linux/killing-a-process-witha-script-part-2/m-p/4962019#M101211</link>
      <description>Hello, &lt;BR /&gt;&lt;BR /&gt;It is not good practice to club "ps" and "grep" together, UNIX 95 variable which bill said is the best method.&lt;BR /&gt;&lt;BR /&gt;# UNIX95= ps -C"exact_process_name" -o pid&lt;BR /&gt;&lt;BR /&gt;-Arun</description>
      <pubDate>Wed, 22 Feb 2006 23:47:10 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/killing-a-process-witha-script-part-2/m-p/4962019#M101211</guid>
      <dc:creator>Arunvijai_4</dc:creator>
      <dc:date>2006-02-22T23:47:10Z</dc:date>
    </item>
    <item>
      <title>Re: Killing a process witha script PART 2</title>
      <link>https://community.hpe.com/t5/operating-system-linux/killing-a-process-witha-script-part-2/m-p/4962020#M101212</link>
      <description>Thank you all again!!!</description>
      <pubDate>Thu, 23 Feb 2006 20:57:42 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/killing-a-process-witha-script-part-2/m-p/4962020#M101212</guid>
      <dc:creator>TheJuiceman</dc:creator>
      <dc:date>2006-02-23T20:57:42Z</dc:date>
    </item>
    <item>
      <title>Re: Killing a process witha script PART 2</title>
      <link>https://community.hpe.com/t5/operating-system-linux/killing-a-process-witha-script-part-2/m-p/4962021#M101213</link>
      <description>above of all. I prefer Unix95 format&lt;BR /&gt;# UNIX95= ps -C"exact_process_name" -o pid</description>
      <pubDate>Thu, 23 Feb 2006 21:16:05 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/killing-a-process-witha-script-part-2/m-p/4962021#M101213</guid>
      <dc:creator>Nguyen Anh Tien</dc:creator>
      <dc:date>2006-02-23T21:16:05Z</dc:date>
    </item>
    <item>
      <title>Re: Killing a process witha script PART 2</title>
      <link>https://community.hpe.com/t5/operating-system-linux/killing-a-process-witha-script-part-2/m-p/4962022#M101214</link>
      <description>closed</description>
      <pubDate>Thu, 23 Feb 2006 21:19:30 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/killing-a-process-witha-script-part-2/m-p/4962022#M101214</guid>
      <dc:creator>TheJuiceman</dc:creator>
      <dc:date>2006-02-23T21:19:30Z</dc:date>
    </item>
  </channel>
</rss>

