<?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: shell help in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/shell-help/m-p/2721056#M948032</link>
    <description>Try this .. I made some modification ..&lt;BR /&gt;&lt;BR /&gt;#!/usr/bin/sh&lt;BR /&gt;echo "pid= \c"&lt;BR /&gt;read my_pid&lt;BR /&gt;&lt;BR /&gt;for PID in `ps -ef|sed 's/^ *//g'|grep -v \^UID|awk '{print $2}'`&lt;BR /&gt;do&lt;BR /&gt;if [ $my_pid -eq $PID ]&lt;BR /&gt;then&lt;BR /&gt;echo "WE FOUND $my_pid IS $PID"&lt;BR /&gt;fi&lt;BR /&gt;done &lt;BR /&gt;&lt;BR /&gt;The "ps -ef" is first filtered by removing spaces from begining of each line. Then pass that to "grep -v \^UID" to take away the first line starting with UID and then print out 2nd field which is the UID.</description>
    <pubDate>Fri, 10 May 2002 02:19:35 GMT</pubDate>
    <dc:creator>S.K. Chan</dc:creator>
    <dc:date>2002-05-10T02:19:35Z</dc:date>
    <item>
      <title>shell help</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/shell-help/m-p/2721055#M948031</link>
      <description>I made shell script finding process&lt;BR /&gt;but I return wrong result&lt;BR /&gt;help me!!&lt;BR /&gt;#!/usr/bin/sh&lt;BR /&gt;echo "pid="&lt;BR /&gt;read my_pid&lt;BR /&gt;ps -ef|while read UID PID PPID DUMMY&lt;BR /&gt;do&lt;BR /&gt;if [ $my_pid ==  $SPID]&lt;BR /&gt;then &lt;BR /&gt;echo "WE FOUND ${my_pid} IS $SPID"&lt;BR /&gt;fi&lt;BR /&gt;done&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;1253&lt;BR /&gt;./j[7]: test: Specify a parameter with this command.&lt;BR /&gt;./j[7]: test: Specify a parameter with this command.&lt;BR /&gt;./j[7]: test: Specify a parameter with this command.&lt;BR /&gt;.&lt;BR /&gt;</description>
      <pubDate>Fri, 10 May 2002 01:36:24 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/shell-help/m-p/2721055#M948031</guid>
      <dc:creator>chin hyeon jung</dc:creator>
      <dc:date>2002-05-10T01:36:24Z</dc:date>
    </item>
    <item>
      <title>Re: shell help</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/shell-help/m-p/2721056#M948032</link>
      <description>Try this .. I made some modification ..&lt;BR /&gt;&lt;BR /&gt;#!/usr/bin/sh&lt;BR /&gt;echo "pid= \c"&lt;BR /&gt;read my_pid&lt;BR /&gt;&lt;BR /&gt;for PID in `ps -ef|sed 's/^ *//g'|grep -v \^UID|awk '{print $2}'`&lt;BR /&gt;do&lt;BR /&gt;if [ $my_pid -eq $PID ]&lt;BR /&gt;then&lt;BR /&gt;echo "WE FOUND $my_pid IS $PID"&lt;BR /&gt;fi&lt;BR /&gt;done &lt;BR /&gt;&lt;BR /&gt;The "ps -ef" is first filtered by removing spaces from begining of each line. Then pass that to "grep -v \^UID" to take away the first line starting with UID and then print out 2nd field which is the UID.</description>
      <pubDate>Fri, 10 May 2002 02:19:35 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/shell-help/m-p/2721056#M948032</guid>
      <dc:creator>S.K. Chan</dc:creator>
      <dc:date>2002-05-10T02:19:35Z</dc:date>
    </item>
  </channel>
</rss>

