<?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 quick question in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/quick-question/m-p/2691458#M55456</link>
    <description>Hi all&lt;BR /&gt;&lt;BR /&gt;I'm trying to create a variable 'pid' from the output of the command&lt;BR /&gt;&lt;BR /&gt;echo $port&lt;BR /&gt;1p15&lt;BR /&gt;&lt;BR /&gt;when i do &lt;BR /&gt;&lt;BR /&gt;ps -ef | grep $port, i get the output from the grep command plus my grep&lt;BR /&gt;&lt;BR /&gt;ie&lt;BR /&gt;&lt;BR /&gt;root   880     1  0  Mar 24  ?         0:25 ocd -n***.**.***.*** -f/dev/telne&lt;BR /&gt;t/1p15 -b01 -p15 -c/etc/ddfa&lt;BR /&gt;root 17786 10571  1 05:29:53 pts/0     0:00&lt;BR /&gt;grep 1p15&lt;BR /&gt;&lt;BR /&gt;I want to create a variable $pid using&lt;BR /&gt;&lt;BR /&gt;pid=`ps -ef | grep $port | awk '{ print $2 }'`&lt;BR /&gt;&lt;BR /&gt;echo $pid&lt;BR /&gt;880 17253&lt;BR /&gt;&lt;BR /&gt;why do I get the first 2 columns from both lines and not just the first?&lt;BR /&gt;&lt;BR /&gt;How can I get $pid to equal the 2nd column of the 1st line?&lt;BR /&gt;&lt;BR /&gt;TIA&lt;BR /&gt;&lt;BR /&gt;Steve&lt;BR /&gt;</description>
    <pubDate>Wed, 27 Mar 2002 05:32:33 GMT</pubDate>
    <dc:creator>steven Burgess_2</dc:creator>
    <dc:date>2002-03-27T05:32:33Z</dc:date>
    <item>
      <title>quick question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/quick-question/m-p/2691458#M55456</link>
      <description>Hi all&lt;BR /&gt;&lt;BR /&gt;I'm trying to create a variable 'pid' from the output of the command&lt;BR /&gt;&lt;BR /&gt;echo $port&lt;BR /&gt;1p15&lt;BR /&gt;&lt;BR /&gt;when i do &lt;BR /&gt;&lt;BR /&gt;ps -ef | grep $port, i get the output from the grep command plus my grep&lt;BR /&gt;&lt;BR /&gt;ie&lt;BR /&gt;&lt;BR /&gt;root   880     1  0  Mar 24  ?         0:25 ocd -n***.**.***.*** -f/dev/telne&lt;BR /&gt;t/1p15 -b01 -p15 -c/etc/ddfa&lt;BR /&gt;root 17786 10571  1 05:29:53 pts/0     0:00&lt;BR /&gt;grep 1p15&lt;BR /&gt;&lt;BR /&gt;I want to create a variable $pid using&lt;BR /&gt;&lt;BR /&gt;pid=`ps -ef | grep $port | awk '{ print $2 }'`&lt;BR /&gt;&lt;BR /&gt;echo $pid&lt;BR /&gt;880 17253&lt;BR /&gt;&lt;BR /&gt;why do I get the first 2 columns from both lines and not just the first?&lt;BR /&gt;&lt;BR /&gt;How can I get $pid to equal the 2nd column of the 1st line?&lt;BR /&gt;&lt;BR /&gt;TIA&lt;BR /&gt;&lt;BR /&gt;Steve&lt;BR /&gt;</description>
      <pubDate>Wed, 27 Mar 2002 05:32:33 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/quick-question/m-p/2691458#M55456</guid>
      <dc:creator>steven Burgess_2</dc:creator>
      <dc:date>2002-03-27T05:32:33Z</dc:date>
    </item>
    <item>
      <title>Re: quick question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/quick-question/m-p/2691459#M55457</link>
      <description>Instead of ..&lt;BR /&gt;&lt;BR /&gt;pid=`ps -ef | grep $port | awk '{ print $2 }'`&lt;BR /&gt;&lt;BR /&gt;you would do ..&lt;BR /&gt;&lt;BR /&gt;pid=`ps -ef | grep $port | grep -v grep | awk '{ print $2 }'`&lt;BR /&gt;&lt;BR /&gt;The "grep -v grep" will filter out the 2nd line.&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 27 Mar 2002 05:49:48 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/quick-question/m-p/2691459#M55457</guid>
      <dc:creator>S.K. Chan</dc:creator>
      <dc:date>2002-03-27T05:49:48Z</dc:date>
    </item>
    <item>
      <title>Re: quick question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/quick-question/m-p/2691460#M55458</link>
      <description>logical &lt;BR /&gt;&lt;BR /&gt;thanks&lt;BR /&gt;&lt;BR /&gt;Steve</description>
      <pubDate>Wed, 27 Mar 2002 05:58:14 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/quick-question/m-p/2691460#M55458</guid>
      <dc:creator>steven Burgess_2</dc:creator>
      <dc:date>2002-03-27T05:58:14Z</dc:date>
    </item>
  </channel>
</rss>

