<?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 -ef  | grep pmon in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/ps-ef-grep-pmon/m-p/4989725#M780955</link>
    <description>grep -v grep is the correct answer . thanks guys for th equick reply.</description>
    <pubDate>Mon, 10 Jul 2006 10:17:24 GMT</pubDate>
    <dc:creator>Jacques Carriere</dc:creator>
    <dc:date>2006-07-10T10:17:24Z</dc:date>
    <item>
      <title>#ps -ef  | grep pmon</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ps-ef-grep-pmon/m-p/4989722#M780952</link>
      <description>Does anyone know how to use the grep and not have the grep command listed in your selection.&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Mon, 10 Jul 2006 09:44:38 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ps-ef-grep-pmon/m-p/4989722#M780952</guid>
      <dc:creator>Jacques Carriere</dc:creator>
      <dc:date>2006-07-10T09:44:38Z</dc:date>
    </item>
    <item>
      <title>Re: #ps -ef  | grep pmon</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ps-ef-grep-pmon/m-p/4989723#M780953</link>
      <description>Shalom,&lt;BR /&gt;&lt;BR /&gt;modify to&lt;BR /&gt;&lt;BR /&gt;ps -ef | grep pmon | grep -v pmon&lt;BR /&gt;&lt;BR /&gt;Even more accurate&lt;BR /&gt;&lt;BR /&gt;UNIX95=1&lt;BR /&gt;ps -C pmon&lt;BR /&gt;&lt;BR /&gt;Do not set UNIX95 permenent, it breaks sd/ux&lt;BR /&gt;&lt;BR /&gt;SEP</description>
      <pubDate>Mon, 10 Jul 2006 09:46:47 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ps-ef-grep-pmon/m-p/4989723#M780953</guid>
      <dc:creator>Steven E. Protter</dc:creator>
      <dc:date>2006-07-10T09:46:47Z</dc:date>
    </item>
    <item>
      <title>Re: #ps -ef  | grep pmon</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ps-ef-grep-pmon/m-p/4989724#M780954</link>
      <description>Jacques,&lt;BR /&gt;&lt;BR /&gt;ps -ef | grep pmon | grep -v grep&lt;BR /&gt;&lt;BR /&gt;PCS</description>
      <pubDate>Mon, 10 Jul 2006 09:48:20 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ps-ef-grep-pmon/m-p/4989724#M780954</guid>
      <dc:creator>spex</dc:creator>
      <dc:date>2006-07-10T09:48:20Z</dc:date>
    </item>
    <item>
      <title>Re: #ps -ef  | grep pmon</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ps-ef-grep-pmon/m-p/4989725#M780955</link>
      <description>grep -v grep is the correct answer . thanks guys for th equick reply.</description>
      <pubDate>Mon, 10 Jul 2006 10:17:24 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ps-ef-grep-pmon/m-p/4989725#M780955</guid>
      <dc:creator>Jacques Carriere</dc:creator>
      <dc:date>2006-07-10T10:17:24Z</dc:date>
    </item>
    <item>
      <title>Re: #ps -ef  | grep pmon</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ps-ef-grep-pmon/m-p/4989726#M780956</link>
      <description>Actually, grep -v is not the correct answer at all. ps has dozens of options that will bypass grep and give you the correct answer. Whenever you combine grep with ps, you'll potentially get a lot of unintended matches. This is because grep has no method to look at a specific field. So in your example, you will get hits for the user "upmon" or the group called "pmons34" and also hits for the process vpmon, and so on. If the output of the grep command was fed to a kill command, you would have a mess of killed processes on your hands.&lt;BR /&gt; &lt;BR /&gt;ps will match the exact name of the process, regardless of whether it was started as ./pmon or /opt/pmonstuff/bin/pmon or simply pmon. It is the C option and must be temporarily enabled with UNIX95, like this:&lt;BR /&gt; &lt;BR /&gt;UNIX95= ps -fC pmon&lt;BR /&gt; &lt;BR /&gt;DO NOT export UNIX95 -- just use it as shown since the variable is temporary just for ps. Making UNIX95 permanent can lead to unexpected behavior of other commands. And yes, the UNIX95= is correct -- it means defined UNIX95 as a null string.&lt;BR /&gt; &lt;BR /&gt;To see how unreliable ps|grep is, try these two commands to find all the shells:&lt;BR /&gt; &lt;BR /&gt;ps -ef | grep -v grep | grep sh&lt;BR /&gt; &lt;BR /&gt;and&lt;BR /&gt; &lt;BR /&gt;UNIX95= ps -fC sh&lt;BR /&gt; &lt;BR /&gt;To make life easier, I simply alias the ps command in .profile so it is always used with ps:&lt;BR /&gt; &lt;BR /&gt;alias ps="UNIX95= /usr/bin/ps"&lt;BR /&gt; &lt;BR /&gt;Now you can type ps and get all the special features like -H and -o, something like this:&lt;BR /&gt; &lt;BR /&gt;ps -eH&lt;BR /&gt; &lt;BR /&gt;ps -C pmon -o vsz,pid,ppid,ruser,args&lt;BR /&gt; &lt;BR /&gt;UNIX95 (when defined even as a null variable) turns on XPG4 behavior as defined in the ps man page.</description>
      <pubDate>Mon, 10 Jul 2006 14:51:46 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ps-ef-grep-pmon/m-p/4989726#M780956</guid>
      <dc:creator>Bill Hassell</dc:creator>
      <dc:date>2006-07-10T14:51:46Z</dc:date>
    </item>
    <item>
      <title>Re: #ps -ef  | grep pmon</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ps-ef-grep-pmon/m-p/4989727#M780957</link>
      <description>Personally I prefer a grep command like:&lt;BR /&gt;#ps -ef | grep p[m]on&lt;BR /&gt;&lt;BR /&gt;Which letter gets the brackets around it doesn't matter, as long as only one charcter is bracketed.</description>
      <pubDate>Mon, 10 Jul 2006 20:52:08 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ps-ef-grep-pmon/m-p/4989727#M780957</guid>
      <dc:creator>Procnus</dc:creator>
      <dc:date>2006-07-10T20:52:08Z</dc:date>
    </item>
    <item>
      <title>Re: #ps -ef  | grep pmon</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ps-ef-grep-pmon/m-p/4989728#M780958</link>
      <description>Jacques,&lt;BR /&gt;&lt;BR /&gt;If my previous response gives false positives, use:&lt;BR /&gt;&lt;BR /&gt;ps -ef | grep ora_pmon_ | grep -v grep&lt;BR /&gt;&lt;BR /&gt;Whenever you grep for something, you need to keep in mind that grep will return any line containing the search pattern in any position.  If you get unintended results, you will need to narrow down the search pattern.  &lt;BR /&gt;&lt;BR /&gt;Understanding the way grep works is an essential trait of any sysadmin, as it is ubiquitous in the Unix world.&lt;BR /&gt;&lt;BR /&gt;PCS&lt;BR /&gt;</description>
      <pubDate>Tue, 11 Jul 2006 06:53:15 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ps-ef-grep-pmon/m-p/4989728#M780958</guid>
      <dc:creator>spex</dc:creator>
      <dc:date>2006-07-11T06:53:15Z</dc:date>
    </item>
    <item>
      <title>Re: #ps -ef  | grep pmon</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ps-ef-grep-pmon/m-p/4989729#M780959</link>
      <description>Good answers. thanks Jacques</description>
      <pubDate>Tue, 11 Jul 2006 08:02:01 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ps-ef-grep-pmon/m-p/4989729#M780959</guid>
      <dc:creator>Jacques Carriere</dc:creator>
      <dc:date>2006-07-11T08:02:01Z</dc:date>
    </item>
  </channel>
</rss>

