<?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 processes that follow in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/kill-processes-that-follow/m-p/3478659#M704375</link>
    <description>Hi,&lt;BR /&gt;can you use the following to extract the data:&lt;BR /&gt;cat &lt;FILE&gt; | sed -n "/MarkerProcess/,/^$/n;p"&lt;BR /&gt;This should extract all the lines from MarkerProcess onwards.&lt;BR /&gt;You can then awk the process id and you should be done.&lt;BR /&gt;Hope this solves the problem.&lt;BR /&gt;Regards&lt;/FILE&gt;</description>
    <pubDate>Fri, 04 Feb 2005 09:35:54 GMT</pubDate>
    <dc:creator>Peter Godron</dc:creator>
    <dc:date>2005-02-04T09:35:54Z</dc:date>
    <item>
      <title>Kill processes that follow</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/kill-processes-that-follow/m-p/3478658#M704374</link>
      <description>The file attached shows the status of multiple processes running on my machine. &lt;BR /&gt;&lt;BR /&gt;I want to kill all the processes that are listed after the 'Marker Process', i.e. Process4, Process5, Process6.&lt;BR /&gt;&lt;BR /&gt;For this I need to extract the process ID of the processes listed after the 'Marker Process'.&lt;BR /&gt;&lt;BR /&gt;Can someone please suggest a way to extract those PIDs. I know that awk '{print $9}' will get me the PIDs, but I only want the ones listed after the 'Marker Process'.&lt;BR /&gt;&lt;BR /&gt;The next line in my code would read:&lt;BR /&gt;kill -9 $killproc&lt;BR /&gt;&lt;BR /&gt;where killproc has the process ids of the above mentioned processes.&lt;BR /&gt;&lt;BR /&gt;Thanks</description>
      <pubDate>Fri, 04 Feb 2005 09:07:53 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/kill-processes-that-follow/m-p/3478658#M704374</guid>
      <dc:creator>tyro</dc:creator>
      <dc:date>2005-02-04T09:07:53Z</dc:date>
    </item>
    <item>
      <title>Re: Kill processes that follow</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/kill-processes-that-follow/m-p/3478659#M704375</link>
      <description>Hi,&lt;BR /&gt;can you use the following to extract the data:&lt;BR /&gt;cat &lt;FILE&gt; | sed -n "/MarkerProcess/,/^$/n;p"&lt;BR /&gt;This should extract all the lines from MarkerProcess onwards.&lt;BR /&gt;You can then awk the process id and you should be done.&lt;BR /&gt;Hope this solves the problem.&lt;BR /&gt;Regards&lt;/FILE&gt;</description>
      <pubDate>Fri, 04 Feb 2005 09:35:54 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/kill-processes-that-follow/m-p/3478659#M704375</guid>
      <dc:creator>Peter Godron</dc:creator>
      <dc:date>2005-02-04T09:35:54Z</dc:date>
    </item>
    <item>
      <title>Re: Kill processes that follow</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/kill-processes-that-follow/m-p/3478660#M704376</link>
      <description>Hello there&lt;BR /&gt;&lt;BR /&gt;This one line should work (/tmp/input is the output you enclosed in your posting):&lt;BR /&gt;&lt;BR /&gt;cat /tmp/input | sed -n '/MarkerProcess/,//p' | grep -v "MarkerProcess" | awk {'print $9'} | xargs kill -9&lt;BR /&gt;&lt;BR /&gt;I'm assuming here though that you will only have Processx lines after the MarkerProcess line?  If not, you can enter another grep to ensure you only have Processx lines to kill:&lt;BR /&gt;&lt;BR /&gt;cat /tmp/kfb.input | sed -n '/MarkerProcess/,//p' | grep -v "MarkerProcess" | grep "^Process" | awk {'print $9'}&lt;BR /&gt;&lt;BR /&gt;All the best - Keith</description>
      <pubDate>Fri, 04 Feb 2005 09:40:18 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/kill-processes-that-follow/m-p/3478660#M704376</guid>
      <dc:creator>Keith Bryson</dc:creator>
      <dc:date>2005-02-04T09:40:18Z</dc:date>
    </item>
    <item>
      <title>Re: Kill processes that follow</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/kill-processes-that-follow/m-p/3478661#M704377</link>
      <description>Sorry, that last line should have included the xargs command:&lt;BR /&gt;&lt;BR /&gt;cat /tmp/input | sed -n '/MarkerProcess/,//p' | grep -v "MarkerProcess" | grep "^Process" | awk {'print $9'} | xargs kill -9&lt;BR /&gt;&lt;BR /&gt;Have fun - Keith</description>
      <pubDate>Fri, 04 Feb 2005 09:46:42 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/kill-processes-that-follow/m-p/3478661#M704377</guid>
      <dc:creator>Keith Bryson</dc:creator>
      <dc:date>2005-02-04T09:46:42Z</dc:date>
    </item>
    <item>
      <title>Re: Kill processes that follow</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/kill-processes-that-follow/m-p/3478662#M704378</link>
      <description>Might be able to feed the process id's to this gkill. You take out the two interactive steps, and it is an automated, process killer.&lt;BR /&gt;&lt;BR /&gt;This is a very powerful tool. Read the code, be familiar with it.&lt;BR /&gt;&lt;BR /&gt;SEP</description>
      <pubDate>Fri, 04 Feb 2005 09:56:10 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/kill-processes-that-follow/m-p/3478662#M704378</guid>
      <dc:creator>Steven E. Protter</dc:creator>
      <dc:date>2005-02-04T09:56:10Z</dc:date>
    </item>
    <item>
      <title>Re: Kill processes that follow</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/kill-processes-that-follow/m-p/3478663#M704379</link>
      <description>Hi Peter,&lt;BR /&gt;I was not able to follow what the line you entered does. Would really appreciate if you could explain what '/^$/n;p' does.&lt;BR /&gt;  &lt;BR /&gt;When I tried using it in my code, and redirected the output to another file, I got an output with the MarkerProcess missing. &lt;BR /&gt;&lt;BR /&gt;But its also listing Process1, Process2 and Process3. I only want Process4, Process5 and Process6 (that follow after MarkerProcess) to get listed. How do I get rid of those ?&lt;BR /&gt;&lt;BR /&gt;Thanks</description>
      <pubDate>Fri, 04 Feb 2005 10:21:32 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/kill-processes-that-follow/m-p/3478663#M704379</guid>
      <dc:creator>tyro</dc:creator>
      <dc:date>2005-02-04T10:21:32Z</dc:date>
    </item>
    <item>
      <title>Re: Kill processes that follow</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/kill-processes-that-follow/m-p/3478664#M704380</link>
      <description>Keith,&lt;BR /&gt;That line was beautiful. Its solved my problem in a jiffy.&lt;BR /&gt;&lt;BR /&gt;Trouble is, now I really want to know how it works. :-)&lt;BR /&gt;&lt;BR /&gt;cat /tmp/input | sed -n '/MarkerProcess/,//p' | grep -v "MarkerProcess" | awk {'print $9'} | xargs kill -9&lt;BR /&gt;&lt;BR /&gt;Understood that the grep -v command helped us exclude 'MarkerProcess' from the search. &lt;BR /&gt;&lt;BR /&gt;Why did you use the ',//p' ? What does it do ?&lt;BR /&gt;&lt;BR /&gt;Google showed me that:&lt;BR /&gt;# To print only lines which match regular expression (emulates "grep")&lt;BR /&gt;sed -n '/regexp/p'  &lt;BR /&gt;&lt;BR /&gt;But sed -n '/MarkerProcess/p' did not work. It gave me a bad argument error. :-S Curious.&lt;BR /&gt;&lt;BR /&gt;Thanks</description>
      <pubDate>Fri, 04 Feb 2005 10:44:05 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/kill-processes-that-follow/m-p/3478664#M704380</guid>
      <dc:creator>tyro</dc:creator>
      <dc:date>2005-02-04T10:44:05Z</dc:date>
    </item>
    <item>
      <title>Re: Kill processes that follow</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/kill-processes-that-follow/m-p/3478665#M704381</link>
      <description>Hi Steven,&lt;BR /&gt;Thanks for the gkill. Really appreciate the idea.&lt;BR /&gt;&lt;BR /&gt;Keith made the moves really swift. :-))</description>
      <pubDate>Fri, 04 Feb 2005 10:47:42 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/kill-processes-that-follow/m-p/3478665#M704381</guid>
      <dc:creator>tyro</dc:creator>
      <dc:date>2005-02-04T10:47:42Z</dc:date>
    </item>
  </channel>
</rss>

