<?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: grep in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/grep/m-p/2966590#M119548</link>
    <description>Here's an alias you can put in your profile that works good:&lt;BR /&gt;&lt;BR /&gt;alias psg='ps -ef | grep -v grep | grep -e PPID -e'</description>
    <pubDate>Tue, 06 May 2003 13:27:03 GMT</pubDate>
    <dc:creator>Tom Danzig</dc:creator>
    <dc:date>2003-05-06T13:27:03Z</dc:date>
    <item>
      <title>grep</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/grep/m-p/2966585#M119543</link>
      <description>How can I issue a ps -ef | grep junk&lt;BR /&gt;but not return the grep command?&lt;BR /&gt;As in&lt;BR /&gt;&lt;BR /&gt; ps -ef | grep junk&lt;BR /&gt;    root  6874  1501  0 10:15:33 pts/tb    0:00 grep junk</description>
      <pubDate>Tue, 06 May 2003 13:16:36 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/grep/m-p/2966585#M119543</guid>
      <dc:creator>Nobody's Hero</dc:creator>
      <dc:date>2003-05-06T13:16:36Z</dc:date>
    </item>
    <item>
      <title>Re: grep</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/grep/m-p/2966586#M119544</link>
      <description>Hi Robert,&lt;BR /&gt;&lt;BR /&gt;# ps -ef | grep junk |grep -v grep&lt;BR /&gt;&lt;BR /&gt;Robert-Jan.</description>
      <pubDate>Tue, 06 May 2003 13:18:44 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/grep/m-p/2966586#M119544</guid>
      <dc:creator>Robert-Jan Goossens</dc:creator>
      <dc:date>2003-05-06T13:18:44Z</dc:date>
    </item>
    <item>
      <title>Re: grep</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/grep/m-p/2966587#M119545</link>
      <description>with:&lt;BR /&gt;&lt;BR /&gt;ps -ef|grep junk |grep -v grep&lt;BR /&gt;&lt;BR /&gt;option -v exclude</description>
      <pubDate>Tue, 06 May 2003 13:20:56 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/grep/m-p/2966587#M119545</guid>
      <dc:creator>Jairo Campana</dc:creator>
      <dc:date>2003-05-06T13:20:56Z</dc:date>
    </item>
    <item>
      <title>Re: grep</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/grep/m-p/2966588#M119546</link>
      <description>Easy, just do this:&lt;BR /&gt;&lt;BR /&gt;ps -ef | grep junk | grep -v "grep"&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Or, better yet, put this little script called psg in /usr/local/bin:&lt;BR /&gt;&lt;BR /&gt;##########################################################################&lt;BR /&gt;#  psg   -   Process Search&lt;BR /&gt;#            Substitute for "ps -ef|grep" command string.&lt;BR /&gt;##########################################################################&lt;BR /&gt;case $# in&lt;BR /&gt;   0) echo "Error: Argument Expected";&lt;BR /&gt;       exit;&lt;BR /&gt;       ;;&lt;BR /&gt;   1) ps -ef | grep $1 | grep -v "grep"&lt;BR /&gt;#  1) UNIX95= ps -fC $1&lt;BR /&gt;       ;;&lt;BR /&gt;   *) echo "Error: Only 1 Argument Allowed";&lt;BR /&gt;       exit;&lt;BR /&gt;       ;;&lt;BR /&gt;esac&lt;BR /&gt;&lt;BR /&gt;Then just do "psg junk"&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Pete</description>
      <pubDate>Tue, 06 May 2003 13:21:20 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/grep/m-p/2966588#M119546</guid>
      <dc:creator>Pete Randall</dc:creator>
      <dc:date>2003-05-06T13:21:20Z</dc:date>
    </item>
    <item>
      <title>Re: grep</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/grep/m-p/2966589#M119547</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;One way to do it is like this:&lt;BR /&gt;&lt;BR /&gt;ps -ef | grep [j]unk&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;But probably the better method  is to use the XPG4 implementation of the 'ps' command to look for the actual command by using the '-C' option:&lt;BR /&gt;&lt;BR /&gt;UNIX95=1 ps -fC junk&lt;BR /&gt;&lt;BR /&gt;I like that because it is much cleaner and you don't have to invite grep to the party.&lt;BR /&gt;&lt;BR /&gt;JP&lt;BR /&gt;</description>
      <pubDate>Tue, 06 May 2003 13:26:57 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/grep/m-p/2966589#M119547</guid>
      <dc:creator>John Poff</dc:creator>
      <dc:date>2003-05-06T13:26:57Z</dc:date>
    </item>
    <item>
      <title>Re: grep</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/grep/m-p/2966590#M119548</link>
      <description>Here's an alias you can put in your profile that works good:&lt;BR /&gt;&lt;BR /&gt;alias psg='ps -ef | grep -v grep | grep -e PPID -e'</description>
      <pubDate>Tue, 06 May 2003 13:27:03 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/grep/m-p/2966590#M119548</guid>
      <dc:creator>Tom Danzig</dc:creator>
      <dc:date>2003-05-06T13:27:03Z</dc:date>
    </item>
    <item>
      <title>Re: grep</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/grep/m-p/2966591#M119549</link>
      <description>I have a script called psg, got it out of a book.&lt;BR /&gt;&lt;BR /&gt;#!/usr/bin/sh&lt;BR /&gt;#&lt;BR /&gt;# Program name : psg&lt;BR /&gt;# Usage : psg some_pattern&lt;BR /&gt;# This program searches through a process status (ps -ef)&lt;BR /&gt;# listing for a pattern given as the first command line&lt;BR /&gt;# argument&lt;BR /&gt;procs=`ps -ef`&lt;BR /&gt;head=`echo "$procs" | line`&lt;BR /&gt;&lt;BR /&gt;echo "$head"&lt;BR /&gt;echo "$procs" | grep -i $1 | grep -v $0 # Write out lines&lt;BR /&gt;      # containing $1 but not thisprograms command line name&lt;BR /&gt;&lt;BR /&gt;# Note that $procs MUSt be quoted or the newlines in the ps&lt;BR /&gt;# -ef listing will be turned into spaces when echoed. $head&lt;BR /&gt;# must also be quoted to preserve any extra whitespace&lt;BR /&gt;&lt;BR /&gt;Lots of ways to get things done with Unix.&lt;BR /&gt;&lt;BR /&gt;SEP</description>
      <pubDate>Tue, 06 May 2003 13:31:30 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/grep/m-p/2966591#M119549</guid>
      <dc:creator>Steven E. Protter</dc:creator>
      <dc:date>2003-05-06T13:31:30Z</dc:date>
    </item>
    <item>
      <title>Re: grep</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/grep/m-p/2966592#M119550</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;ps -ef | grep junk | grep -v "grep" &lt;BR /&gt;&lt;BR /&gt;sould do</description>
      <pubDate>Tue, 06 May 2003 13:54:04 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/grep/m-p/2966592#M119550</guid>
      <dc:creator>Ravi_8</dc:creator>
      <dc:date>2003-05-06T13:54:04Z</dc:date>
    </item>
  </channel>
</rss>

