<?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 grep the string only, not including grep command itself in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/grep-the-string-only-not-including-grep-command-itself/m-p/3026789#M131736</link>
    <description>When I "grep" a string there is always a additional line for the grep command itself come out. HOw do I have grep only come out one line, in stead of two line?&lt;BR /&gt;&lt;BR /&gt;Ex, ps -ef | grep vhand&lt;BR /&gt;two line output:&lt;BR /&gt;............vhand&lt;BR /&gt;............grep vhand</description>
    <pubDate>Thu, 17 Jul 2003 18:33:30 GMT</pubDate>
    <dc:creator>Hanry Zhou</dc:creator>
    <dc:date>2003-07-17T18:33:30Z</dc:date>
    <item>
      <title>grep the string only, not including grep command itself</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/grep-the-string-only-not-including-grep-command-itself/m-p/3026789#M131736</link>
      <description>When I "grep" a string there is always a additional line for the grep command itself come out. HOw do I have grep only come out one line, in stead of two line?&lt;BR /&gt;&lt;BR /&gt;Ex, ps -ef | grep vhand&lt;BR /&gt;two line output:&lt;BR /&gt;............vhand&lt;BR /&gt;............grep vhand</description>
      <pubDate>Thu, 17 Jul 2003 18:33:30 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/grep-the-string-only-not-including-grep-command-itself/m-p/3026789#M131736</guid>
      <dc:creator>Hanry Zhou</dc:creator>
      <dc:date>2003-07-17T18:33:30Z</dc:date>
    </item>
    <item>
      <title>Re: grep the string only, not including grep command itself</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/grep-the-string-only-not-including-grep-command-itself/m-p/3026790#M131737</link>
      <description>Add a '| grep -v grep' to your command.&lt;BR /&gt;&lt;BR /&gt;# ps -ef | grep vhand | grep -v grep</description>
      <pubDate>Thu, 17 Jul 2003 18:36:53 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/grep-the-string-only-not-including-grep-command-itself/m-p/3026790#M131737</guid>
      <dc:creator>Patrick Wallek</dc:creator>
      <dc:date>2003-07-17T18:36:53Z</dc:date>
    </item>
    <item>
      <title>Re: grep the string only, not including grep command itself</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/grep-the-string-only-not-including-grep-command-itself/m-p/3026791#M131738</link>
      <description>Hi:&lt;BR /&gt;&lt;BR /&gt;# ps -ef|grep vhand|grep -v "grep vhand"  &lt;BR /&gt;&lt;BR /&gt;...is your direct answer&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Thu, 17 Jul 2003 18:40:16 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/grep-the-string-only-not-including-grep-command-itself/m-p/3026791#M131738</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2003-07-17T18:40:16Z</dc:date>
    </item>
    <item>
      <title>Re: grep the string only, not including grep command itself</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/grep-the-string-only-not-including-grep-command-itself/m-p/3026792#M131739</link>
      <description>Hi (again):&lt;BR /&gt;&lt;BR /&gt;...however, if you are looking for a process(es) by name, a better way is to leverage the XPG4 (UNIX95) option to select the process by its basename and display the data you want.  FOr instance:&lt;BR /&gt;&lt;BR /&gt;# UNIX95= ps -C vhand -o args,pid,ppid,sz,comm&lt;BR /&gt;&lt;BR /&gt;To eliminate the headings from 'ps':&lt;BR /&gt;&lt;BR /&gt;# UNIX95= ps -C vhand -o args,pid,ppid,sz,comm|awk '/NR&amp;gt;1/'&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Thu, 17 Jul 2003 18:45:22 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/grep-the-string-only-not-including-grep-command-itself/m-p/3026792#M131739</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2003-07-17T18:45:22Z</dc:date>
    </item>
    <item>
      <title>Re: grep the string only, not including grep command itself</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/grep-the-string-only-not-including-grep-command-itself/m-p/3026793#M131740</link>
      <description>I have a script called psg which does this automatically, without having to type out the command line options.&lt;BR /&gt;&lt;BR /&gt;I am attaching it.  Usage is psg &lt;CRITERIA&gt; it does reliably eliminate the grep process.&lt;BR /&gt;&lt;BR /&gt;SEP&lt;/CRITERIA&gt;</description>
      <pubDate>Thu, 17 Jul 2003 18:48:50 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/grep-the-string-only-not-including-grep-command-itself/m-p/3026793#M131740</guid>
      <dc:creator>Steven E. Protter</dc:creator>
      <dc:date>2003-07-17T18:48:50Z</dc:date>
    </item>
    <item>
      <title>Re: grep the string only, not including grep command itself</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/grep-the-string-only-not-including-grep-command-itself/m-p/3026794#M131741</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;Another alternative to the "| grep -v grep" extension is to enclose the first character of your grep string inside [] - basically, this turns the command into a regular expression.&lt;BR /&gt;&lt;BR /&gt;For example:-&lt;BR /&gt;&lt;BR /&gt;$ ps -ef | grep vhand | grep -v grep&lt;BR /&gt;&lt;BR /&gt;can also be written as:-&lt;BR /&gt;&lt;BR /&gt;$ ps -ef | grep [v]hand&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;This is a quick and easy alternative when entering the command interactively, but the "| grep -v grep" is far easier to use within shell scripts, especially if the grep string is a substituted variable.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Rgds,&lt;BR /&gt;Paul.</description>
      <pubDate>Thu, 17 Jul 2003 20:10:26 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/grep-the-string-only-not-including-grep-command-itself/m-p/3026794#M131741</guid>
      <dc:creator>Paul Murray_4</dc:creator>
      <dc:date>2003-07-17T20:10:26Z</dc:date>
    </item>
    <item>
      <title>Re: grep the string only, not including grep command itself</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/grep-the-string-only-not-including-grep-command-itself/m-p/3026795#M131742</link>
      <description>Hello!&lt;BR /&gt;&lt;BR /&gt;Do:&lt;BR /&gt;ps -ef |grep -v grep | grep vhand&lt;BR /&gt;&lt;BR /&gt;Caesar</description>
      <pubDate>Thu, 17 Jul 2003 20:31:57 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/grep-the-string-only-not-including-grep-command-itself/m-p/3026795#M131742</guid>
      <dc:creator>Caesar_3</dc:creator>
      <dc:date>2003-07-17T20:31:57Z</dc:date>
    </item>
    <item>
      <title>Re: grep the string only, not including grep command itself</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/grep-the-string-only-not-including-grep-command-itself/m-p/3026796#M131743</link>
      <description>ps -ef |grep [v]hand</description>
      <pubDate>Thu, 17 Jul 2003 21:20:48 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/grep-the-string-only-not-including-grep-command-itself/m-p/3026796#M131743</guid>
      <dc:creator>Kevin Wright</dc:creator>
      <dc:date>2003-07-17T21:20:48Z</dc:date>
    </item>
  </channel>
</rss>

