<?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: ps command question in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/ps-command-question/m-p/2947243#M114987</link>
    <description>ps -ef |grep happy&lt;BR /&gt;&lt;BR /&gt;should do it.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Pete</description>
    <pubDate>Wed, 09 Apr 2003 13:39:53 GMT</pubDate>
    <dc:creator>Pete Randall</dc:creator>
    <dc:date>2003-04-09T13:39:53Z</dc:date>
    <item>
      <title>ps command question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ps-command-question/m-p/2947242#M114986</link>
      <description>I am on an HP-UX 11.11 box and wish to obtain the process id of a specific program (let's call it happy).  Long ago, I thought I used to use a variation of the ps command such as:&lt;BR /&gt;ps -C happy&lt;BR /&gt;&lt;BR /&gt;This doesn't seem to work on HP-UX 11.11.  Does any one know how I could obtain the process id of the program (which I need to feed to a kill -9 command to shut down each instance of the "happy" program.&lt;BR /&gt;&lt;BR /&gt;Thank you!!!</description>
      <pubDate>Wed, 09 Apr 2003 13:37:12 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ps-command-question/m-p/2947242#M114986</guid>
      <dc:creator>Doug High_1</dc:creator>
      <dc:date>2003-04-09T13:37:12Z</dc:date>
    </item>
    <item>
      <title>Re: ps command question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ps-command-question/m-p/2947243#M114987</link>
      <description>ps -ef |grep happy&lt;BR /&gt;&lt;BR /&gt;should do it.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Pete</description>
      <pubDate>Wed, 09 Apr 2003 13:39:53 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ps-command-question/m-p/2947243#M114987</guid>
      <dc:creator>Pete Randall</dc:creator>
      <dc:date>2003-04-09T13:39:53Z</dc:date>
    </item>
    <item>
      <title>Re: ps command question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ps-command-question/m-p/2947244#M114988</link>
      <description>-C option I thing is for xpg4.&lt;BR /&gt;&lt;BR /&gt;Try this..&lt;BR /&gt;UNIX95= ps -C happy&lt;BR /&gt;&lt;BR /&gt;-USA..</description>
      <pubDate>Wed, 09 Apr 2003 13:44:24 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ps-command-question/m-p/2947244#M114988</guid>
      <dc:creator>Uday_S_Ankolekar</dc:creator>
      <dc:date>2003-04-09T13:44:24Z</dc:date>
    </item>
    <item>
      <title>Re: ps command question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ps-command-question/m-p/2947245#M114989</link>
      <description>think..not thing...!!Sorry.</description>
      <pubDate>Wed, 09 Apr 2003 13:46:45 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ps-command-question/m-p/2947245#M114989</guid>
      <dc:creator>Uday_S_Ankolekar</dc:creator>
      <dc:date>2003-04-09T13:46:45Z</dc:date>
    </item>
    <item>
      <title>Re: ps command question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ps-command-question/m-p/2947246#M114990</link>
      <description>Hi.  I tried the ps -C happy and I got an "illegal option" message.  &lt;BR /&gt;&lt;BR /&gt;I'm familiar with the ps -ef | grep happy but the only thing I need is the actual PID of happy (not the rest of the stuff) and I then want to pass the PID's of any occurence to happy to:&lt;BR /&gt;&lt;BR /&gt;kill -9 PID1 PID2 PID3, etc.,etc,e tc.&lt;BR /&gt;&lt;BR /&gt;(all within a script).  Manually doing this is no problem....but I'd really like to pass the PID and only the PID's of happy to kill -9.&lt;BR /&gt;&lt;BR /&gt;Thanks for the prompt responses!&lt;BR /&gt;</description>
      <pubDate>Wed, 09 Apr 2003 13:49:08 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ps-command-question/m-p/2947246#M114990</guid>
      <dc:creator>Doug High_1</dc:creator>
      <dc:date>2003-04-09T13:49:08Z</dc:date>
    </item>
    <item>
      <title>Re: ps command question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ps-command-question/m-p/2947247#M114991</link>
      <description>&lt;BR /&gt;&lt;BR /&gt;Hello,&lt;BR /&gt;&lt;BR /&gt;Try this script.&lt;BR /&gt;&lt;BR /&gt;Olav</description>
      <pubDate>Wed, 09 Apr 2003 13:49:21 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ps-command-question/m-p/2947247#M114991</guid>
      <dc:creator>Olav Baadsvik</dc:creator>
      <dc:date>2003-04-09T13:49:21Z</dc:date>
    </item>
    <item>
      <title>Re: ps command question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ps-command-question/m-p/2947248#M114992</link>
      <description>Try this:&lt;BR /&gt;&lt;BR /&gt;for i in `ps -ef | grep happy | grep -v grep | awk '{print $2}'`&lt;BR /&gt;        do&lt;BR /&gt;                kill -9 $i&lt;BR /&gt;        done&lt;BR /&gt;&lt;BR /&gt;DR</description>
      <pubDate>Wed, 09 Apr 2003 13:57:08 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ps-command-question/m-p/2947248#M114992</guid>
      <dc:creator>Dario_1</dc:creator>
      <dc:date>2003-04-09T13:57:08Z</dc:date>
    </item>
    <item>
      <title>Re: ps command question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ps-command-question/m-p/2947249#M114993</link>
      <description>Doug,&lt;BR /&gt;&lt;BR /&gt;Then this should do it:&lt;BR /&gt;&lt;BR /&gt;ps -ef | grep ' '$USERNAME' ' | grep -v "resetuser" | awk '{ print $1,$2 }'&lt;BR /&gt;&amp;gt; /tmp/reset.tmp&lt;BR /&gt;    PROCESSES=`grep $USERNAME /tmp/reset.tmp | awk '{ print $2 }' | sort -n`&lt;BR /&gt;    for PROC in $PROCESSES&lt;BR /&gt;    do&lt;BR /&gt;       echo "\tKilling process $PROC"&lt;BR /&gt;       kill $PROC&lt;BR /&gt;    done&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Pete</description>
      <pubDate>Wed, 09 Apr 2003 13:59:33 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ps-command-question/m-p/2947249#M114993</guid>
      <dc:creator>Pete Randall</dc:creator>
      <dc:date>2003-04-09T13:59:33Z</dc:date>
    </item>
    <item>
      <title>Re: ps command question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ps-command-question/m-p/2947250#M114994</link>
      <description>Dario.  That did the trick. Many thanks to you and to all who responded so promptly!</description>
      <pubDate>Wed, 09 Apr 2003 14:02:09 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ps-command-question/m-p/2947250#M114994</guid>
      <dc:creator>Doug High_1</dc:creator>
      <dc:date>2003-04-09T14:02:09Z</dc:date>
    </item>
    <item>
      <title>Re: ps command question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ps-command-question/m-p/2947251#M114995</link>
      <description>Actually, that's going after all processes of a particular user.  Change $USERID to $PROGRAM and set it to "happy".&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Pete</description>
      <pubDate>Wed, 09 Apr 2003 14:02:31 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ps-command-question/m-p/2947251#M114995</guid>
      <dc:creator>Pete Randall</dc:creator>
      <dc:date>2003-04-09T14:02:31Z</dc:date>
    </item>
    <item>
      <title>Re: ps command question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ps-command-question/m-p/2947252#M114996</link>
      <description>Hi Doug:&lt;BR /&gt;&lt;BR /&gt;You merely forgot to set the XPG4 (UNIX95) option.  For exmaple, to find the 'pid' of the 'syncer' daemon, di:&lt;BR /&gt;&lt;BR /&gt;# UNIX95= ps -C syncer|awk 'NR&amp;gt;1 {print $1}'&lt;BR /&gt;&lt;BR /&gt;Note that a space follows the UNIX95= and there is no semicolon before the 'ps'.  That set's UNIX95 only for the command line.&lt;BR /&gt;&lt;BR /&gt;In the avove, I skip the header returned from 'ps' and grab the pid (column-1) for the "syncer" daemon.&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...&lt;BR /&gt;</description>
      <pubDate>Wed, 09 Apr 2003 14:06:54 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ps-command-question/m-p/2947252#M114996</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2003-04-09T14:06:54Z</dc:date>
    </item>
    <item>
      <title>Re: ps command question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ps-command-question/m-p/2947253#M114997</link>
      <description>Hi (again) Doug:&lt;BR /&gt;&lt;BR /&gt;Beware using a simple 'grep' to find the process you truly want!  You will return lines that match "happy" when "happy" is a command (basename) *and* when "happy" happens to be an argument to some other command!&lt;BR /&gt;&lt;BR /&gt;Therein lies the value of using XPG4 (UNIX95) extentions.&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Wed, 09 Apr 2003 14:14:11 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ps-command-question/m-p/2947253#M114997</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2003-04-09T14:14:11Z</dc:date>
    </item>
  </channel>
</rss>

