<?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: pid in shell script again... in Operating System - Linux</title>
    <link>https://community.hpe.com/t5/operating-system-linux/pid-in-shell-script-again/m-p/4022672#M64413</link>
    <description>Hi&lt;BR /&gt;&lt;BR /&gt;You can write a perl script as below.&lt;BR /&gt;&lt;BR /&gt;#!/usr/local/bin/perl&lt;BR /&gt; @test = `ps ux | awk '/mojo/ &amp;amp;&amp;amp; !/awk/ {print $2}'`;&lt;BR /&gt; foreach $test (@test)&lt;BR /&gt; {&lt;BR /&gt;  print "$test\n";&lt;BR /&gt; }&lt;BR /&gt;&lt;BR /&gt;save it to a file by name pid.pl&lt;BR /&gt;and chmod +x pid.pl&lt;BR /&gt;and invoke it&lt;BR /&gt;./pid.pl&lt;BR /&gt;&lt;BR /&gt;HTH&lt;BR /&gt;Padma</description>
    <pubDate>Tue, 19 Jun 2007 11:10:10 GMT</pubDate>
    <dc:creator>Padma Asrani</dc:creator>
    <dc:date>2007-06-19T11:10:10Z</dc:date>
    <item>
      <title>pid in shell script again...</title>
      <link>https://community.hpe.com/t5/operating-system-linux/pid-in-shell-script-again/m-p/4022670#M64411</link>
      <description>hi if thr r two process id s from the following command how to pick the second process id.&lt;BR /&gt;l=`ps ux | awk '/mojo/ &amp;amp;&amp;amp; !/awk/ {print $2}'`&lt;BR /&gt;echo $l;&lt;BR /&gt;And if the o/p is &lt;BR /&gt;17665&lt;BR /&gt;17867&lt;BR /&gt;how to store this in an array and retrieve each one of thm whn needed</description>
      <pubDate>Tue, 19 Jun 2007 07:24:52 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/pid-in-shell-script-again/m-p/4022670#M64411</guid>
      <dc:creator>Karthik_sg</dc:creator>
      <dc:date>2007-06-19T07:24:52Z</dc:date>
    </item>
    <item>
      <title>Re: pid in shell script again...</title>
      <link>https://community.hpe.com/t5/operating-system-linux/pid-in-shell-script-again/m-p/4022671#M64412</link>
      <description>Hi&lt;BR /&gt;&lt;BR /&gt;l=$(ps -C mojo -o pid= | sed -n "2p" )&lt;BR /&gt;&lt;BR /&gt;rgds&lt;BR /&gt;HGH&lt;BR /&gt;</description>
      <pubDate>Tue, 19 Jun 2007 08:50:17 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/pid-in-shell-script-again/m-p/4022671#M64412</guid>
      <dc:creator>Hemmetter</dc:creator>
      <dc:date>2007-06-19T08:50:17Z</dc:date>
    </item>
    <item>
      <title>Re: pid in shell script again...</title>
      <link>https://community.hpe.com/t5/operating-system-linux/pid-in-shell-script-again/m-p/4022672#M64413</link>
      <description>Hi&lt;BR /&gt;&lt;BR /&gt;You can write a perl script as below.&lt;BR /&gt;&lt;BR /&gt;#!/usr/local/bin/perl&lt;BR /&gt; @test = `ps ux | awk '/mojo/ &amp;amp;&amp;amp; !/awk/ {print $2}'`;&lt;BR /&gt; foreach $test (@test)&lt;BR /&gt; {&lt;BR /&gt;  print "$test\n";&lt;BR /&gt; }&lt;BR /&gt;&lt;BR /&gt;save it to a file by name pid.pl&lt;BR /&gt;and chmod +x pid.pl&lt;BR /&gt;and invoke it&lt;BR /&gt;./pid.pl&lt;BR /&gt;&lt;BR /&gt;HTH&lt;BR /&gt;Padma</description>
      <pubDate>Tue, 19 Jun 2007 11:10:10 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/pid-in-shell-script-again/m-p/4022672#M64413</guid>
      <dc:creator>Padma Asrani</dc:creator>
      <dc:date>2007-06-19T11:10:10Z</dc:date>
    </item>
    <item>
      <title>Re: pid in shell script again...</title>
      <link>https://community.hpe.com/t5/operating-system-linux/pid-in-shell-script-again/m-p/4022673#M64414</link>
      <description>#!/bin/bash -vx&lt;BR /&gt;&lt;BR /&gt;# Pick 2nd (last) PID.&lt;BR /&gt;l=`ps ux | awk '/root/ &amp;amp;&amp;amp; !/awk/ {print $2}' | tail -1`&lt;BR /&gt;echo $l&lt;BR /&gt;&lt;BR /&gt;# Place PIDs in array ary&lt;BR /&gt;l=`ps ux | awk '/root/ &amp;amp;&amp;amp; !/awk/ {print $2}'`&lt;BR /&gt;ary=($l)&lt;BR /&gt;&lt;BR /&gt;Vic</description>
      <pubDate>Tue, 19 Jun 2007 12:58:50 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/pid-in-shell-script-again/m-p/4022673#M64414</guid>
      <dc:creator>Victor Semaska_3</dc:creator>
      <dc:date>2007-06-19T12:58:50Z</dc:date>
    </item>
  </channel>
</rss>

