<?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 command acts stupid in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/grep-command-acts-stupid/m-p/4882869#M846752</link>
    <description>If you are looking for a specific program name, then your command line can be simplified to:&lt;BR /&gt; &lt;BR /&gt;UNIX95= ps -fC armserver&lt;BR /&gt; &lt;BR /&gt;UNIX95 turns on additional options in grep, -C being the most useful. ps -e is very intrusive on a busy system which is why it's best to let ps (and not grep) look for the processes by name. You can use multiple -C options just like -e in grep:&lt;BR /&gt; &lt;BR /&gt;UNIX95= ps -f -C armserver -C arraymond</description>
    <pubDate>Tue, 01 Feb 2005 09:46:05 GMT</pubDate>
    <dc:creator>Bill Hassell</dc:creator>
    <dc:date>2005-02-01T09:46:05Z</dc:date>
    <item>
      <title>grep command acts stupid</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/grep-command-acts-stupid/m-p/4882849#M846732</link>
      <description>Hi,&lt;BR /&gt;does any one have any idea why grep fails to honour any options assigned to it, say like&lt;BR /&gt;&lt;BR /&gt;ps -eaf | grep -i armserver | grep -v grep&lt;BR /&gt;&lt;BR /&gt;should display all lines matching with armserver but not catch grep itself, but the command fails sating -v is unknow option. similarly I have probems when I specific mutiple strings using -e option.&lt;BR /&gt;&lt;BR /&gt;can any one tell me why some commands act so strange.</description>
      <pubDate>Sun, 30 Jan 2005 05:33:49 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/grep-command-acts-stupid/m-p/4882849#M846732</guid>
      <dc:creator>Shantaram Sahyadri</dc:creator>
      <dc:date>2005-01-30T05:33:49Z</dc:date>
    </item>
    <item>
      <title>Re: grep command acts stupid</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/grep-command-acts-stupid/m-p/4882850#M846733</link>
      <description>Which grep are you using - check its the usual one in /usr/bin by issuing the following command:&lt;BR /&gt;&lt;BR /&gt;which grep&lt;BR /&gt;&lt;BR /&gt;Also check you don't have an alias set for it by listing all your aliases:&lt;BR /&gt;&lt;BR /&gt;alias&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;HTH&lt;BR /&gt;&lt;BR /&gt;Duncan</description>
      <pubDate>Sun, 30 Jan 2005 05:42:31 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/grep-command-acts-stupid/m-p/4882850#M846733</guid>
      <dc:creator>Duncan Edmonstone</dc:creator>
      <dc:date>2005-01-30T05:42:31Z</dc:date>
    </item>
    <item>
      <title>Re: grep command acts stupid</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/grep-command-acts-stupid/m-p/4882851#M846734</link>
      <description>Right, check which grep is being used and/or an alias perhpas.&lt;BR /&gt;&lt;BR /&gt;As for the original problem, searching for a ps line without finding the searcher, I like to use a very simple regular expression instead of the target string.&lt;BR /&gt;For example grep for "armserve[r]" instead of armserver. This will no long match the grep command itself.&lt;BR /&gt;&lt;BR /&gt;Hein.&lt;BR /&gt;</description>
      <pubDate>Sun, 30 Jan 2005 08:38:44 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/grep-command-acts-stupid/m-p/4882851#M846734</guid>
      <dc:creator>Hein van den Heuvel</dc:creator>
      <dc:date>2005-01-30T08:38:44Z</dc:date>
    </item>
    <item>
      <title>Re: grep command acts stupid</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/grep-command-acts-stupid/m-p/4882852#M846735</link>
      <description>Hi,&lt;BR /&gt;Thanks for your reply,&lt;BR /&gt;&lt;BR /&gt;I am using /usr/bin/grep itself, and problem seems to occur when it is been called from within a script.&lt;BR /&gt;I alos tried using the UNIX95 option, still it does sometimes does the same act.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Mon, 31 Jan 2005 05:38:43 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/grep-command-acts-stupid/m-p/4882852#M846735</guid>
      <dc:creator>Shantaram Sahyadri</dc:creator>
      <dc:date>2005-01-31T05:38:43Z</dc:date>
    </item>
    <item>
      <title>Re: grep command acts stupid</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/grep-command-acts-stupid/m-p/4882853#M846736</link>
      <description>Hi,&lt;BR /&gt;if the problem only occures inside the script, try the which grep within the script, as you may be changing PATH.&lt;BR /&gt;Regards</description>
      <pubDate>Mon, 31 Jan 2005 06:01:13 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/grep-command-acts-stupid/m-p/4882853#M846736</guid>
      <dc:creator>Peter Godron</dc:creator>
      <dc:date>2005-01-31T06:01:13Z</dc:date>
    </item>
    <item>
      <title>Re: grep command acts stupid</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/grep-command-acts-stupid/m-p/4882854#M846737</link>
      <description>Hi,&lt;BR /&gt;inside the scrip has variabe defined for grep like&lt;BR /&gt;&lt;BR /&gt;GREP=/usr/bin/grep&lt;BR /&gt;&lt;BR /&gt;so there is issue of PATH settings.</description>
      <pubDate>Mon, 31 Jan 2005 06:09:54 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/grep-command-acts-stupid/m-p/4882854#M846737</guid>
      <dc:creator>Shantaram Sahyadri</dc:creator>
      <dc:date>2005-01-31T06:09:54Z</dc:date>
    </item>
    <item>
      <title>Re: grep command acts stupid</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/grep-command-acts-stupid/m-p/4882855#M846738</link>
      <description>hey there is some typing error in my last message.&lt;BR /&gt;&lt;BR /&gt;In side the script I have a variable defined for all tools used&lt;BR /&gt;like &lt;BR /&gt;&lt;BR /&gt;GREP=/usr/bin/grep&lt;BR /&gt;AWK=/usr/bin/awk&lt;BR /&gt;&lt;BR /&gt;so when executing the script there is not path problems to encounterd.&lt;BR /&gt;&lt;BR /&gt;regards</description>
      <pubDate>Mon, 31 Jan 2005 06:41:41 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/grep-command-acts-stupid/m-p/4882855#M846738</guid>
      <dc:creator>Shantaram Sahyadri</dc:creator>
      <dc:date>2005-01-31T06:41:41Z</dc:date>
    </item>
    <item>
      <title>Re: grep command acts stupid</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/grep-command-acts-stupid/m-p/4882856#M846739</link>
      <description>do a &lt;BR /&gt;what `which grep`&lt;BR /&gt; and a &lt;BR /&gt;what /usr/bin/grep&lt;BR /&gt;&lt;BR /&gt;example:&lt;BR /&gt;[root@vpart3 /opt/appl]# what `which grep`&lt;BR /&gt;/usr/bin/grep:&lt;BR /&gt;         $Revision: B.11.11_LR&lt;BR /&gt;         Fri Oct 27 00:57:38 PDT 2000 $&lt;BR /&gt;[root@vpart3 /opt/appl]# &lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Is this by chance a 10.20 or less HP-ux??&lt;BR /&gt;&lt;BR /&gt;Or is this a sun box??&lt;BR /&gt;&lt;BR /&gt;Does the error look like this when you use the "-e" option?&lt;BR /&gt;&lt;BR /&gt;[root@pbsbcp /]# ps -ef | grep -e root&lt;BR /&gt;grep: illegal option -- e&lt;BR /&gt;Usage: grep -hblcnsviw pattern file . . .&lt;BR /&gt;[root@pbsbcp /]# &lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;live free or die&lt;BR /&gt;harry d brown jr</description>
      <pubDate>Mon, 31 Jan 2005 06:56:42 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/grep-command-acts-stupid/m-p/4882856#M846739</guid>
      <dc:creator>harry d brown jr</dc:creator>
      <dc:date>2005-01-31T06:56:42Z</dc:date>
    </item>
    <item>
      <title>Re: grep command acts stupid</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/grep-command-acts-stupid/m-p/4882857#M846740</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;Thanks harry for u reply,&lt;BR /&gt;&lt;BR /&gt;this is a HP 9000/800/L2000 running 11i v1 with Gold Base June 2004 and another with Dec 2004 patch. yes the probem occurs usally when used with -e switch.&lt;BR /&gt;&lt;BR /&gt;well I have the same script dito working in some other 11i boxes as well was linux and sun boxes. it works fine every where.</description>
      <pubDate>Mon, 31 Jan 2005 07:02:43 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/grep-command-acts-stupid/m-p/4882857#M846740</guid>
      <dc:creator>Shantaram Sahyadri</dc:creator>
      <dc:date>2005-01-31T07:02:43Z</dc:date>
    </item>
    <item>
      <title>Re: grep command acts stupid</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/grep-command-acts-stupid/m-p/4882858#M846741</link>
      <description>And what does&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;what `which grep`&lt;BR /&gt;and &lt;BR /&gt;what /usr/bin/grep&lt;BR /&gt;&lt;BR /&gt;return??&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;live free or die&lt;BR /&gt;harry d brown jr</description>
      <pubDate>Mon, 31 Jan 2005 07:04:36 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/grep-command-acts-stupid/m-p/4882858#M846741</guid>
      <dc:creator>harry d brown jr</dc:creator>
      <dc:date>2005-01-31T07:04:36Z</dc:date>
    </item>
    <item>
      <title>Re: grep command acts stupid</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/grep-command-acts-stupid/m-p/4882859#M846742</link>
      <description>Or do 'set -x' before and 'set +x' after the failing commandline to make sure what happens. This will print (a lot of) debugging info on what goes on in a commandline...</description>
      <pubDate>Mon, 31 Jan 2005 09:12:50 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/grep-command-acts-stupid/m-p/4882859#M846742</guid>
      <dc:creator>Elmar P. Kolkman</dc:creator>
      <dc:date>2005-01-31T09:12:50Z</dc:date>
    </item>
    <item>
      <title>Re: grep command acts stupid</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/grep-command-acts-stupid/m-p/4882860#M846743</link>
      <description>Since you say you are doing-&lt;BR /&gt;GREP=/usr/bin/grep&lt;BR /&gt; &lt;BR /&gt;does that mean in your script you are doing-&lt;BR /&gt;ps -eaf | $GREP -i armserver | $GREP -v grep&lt;BR /&gt; &lt;BR /&gt;If you are not, then the GREP= line isn't doing anything. If you are assuming it identfies where the command is, you are mistaken. The variable "PATH" defines where commands are looked for.&lt;BR /&gt; &lt;BR /&gt;-- Rod Hills</description>
      <pubDate>Mon, 31 Jan 2005 10:18:35 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/grep-command-acts-stupid/m-p/4882860#M846743</guid>
      <dc:creator>Rodney Hills</dc:creator>
      <dc:date>2005-01-31T10:18:35Z</dc:date>
    </item>
    <item>
      <title>Re: grep command acts stupid</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/grep-command-acts-stupid/m-p/4882861#M846744</link>
      <description>Hi &lt;BR /&gt;Thanks for all your help,&lt;BR /&gt;&lt;BR /&gt;yes the script goes like&lt;BR /&gt;&lt;BR /&gt;GREP=/usr/bin/grep&lt;BR /&gt;&lt;BR /&gt;ps -eaf | $GREP -i armserver | $GREP -v grep&lt;BR /&gt;&lt;BR /&gt;regards&lt;BR /&gt;</description>
      <pubDate>Tue, 01 Feb 2005 01:09:33 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/grep-command-acts-stupid/m-p/4882861#M846744</guid>
      <dc:creator>Shantaram Sahyadri</dc:creator>
      <dc:date>2005-02-01T01:09:33Z</dc:date>
    </item>
    <item>
      <title>Re: grep command acts stupid</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/grep-command-acts-stupid/m-p/4882862#M846745</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;-e expects a pattern and has to come after -v. Do you use it that way?&lt;BR /&gt;&lt;BR /&gt;greetings,&lt;BR /&gt;&lt;BR /&gt;Michael&lt;BR /&gt;</description>
      <pubDate>Tue, 01 Feb 2005 02:16:09 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/grep-command-acts-stupid/m-p/4882862#M846745</guid>
      <dc:creator>Michael Schulte zur Sur</dc:creator>
      <dc:date>2005-02-01T02:16:09Z</dc:date>
    </item>
    <item>
      <title>Re: grep command acts stupid</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/grep-command-acts-stupid/m-p/4882863#M846746</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;here is the line as it is in the script&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;GREP=/usr/bin/grep&lt;BR /&gt;set -x&lt;BR /&gt;ps -eaf | $GREP -i -e armserver -e arraymod | grep -v grep&lt;BR /&gt;set +x&lt;BR /&gt;</description>
      <pubDate>Tue, 01 Feb 2005 03:22:24 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/grep-command-acts-stupid/m-p/4882863#M846746</guid>
      <dc:creator>Shantaram Sahyadri</dc:creator>
      <dc:date>2005-02-01T03:22:24Z</dc:date>
    </item>
    <item>
      <title>Re: grep command acts stupid</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/grep-command-acts-stupid/m-p/4882864#M846747</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;the output of what command is&lt;BR /&gt;&lt;BR /&gt;# what `which grep`&lt;BR /&gt;/usr/bin/grep:&lt;BR /&gt;         $Revision: B.11.11_LR&lt;BR /&gt;         Fri Oct 27 00:57:38 PDT 2000 $&lt;BR /&gt;</description>
      <pubDate>Tue, 01 Feb 2005 03:24:31 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/grep-command-acts-stupid/m-p/4882864#M846747</guid>
      <dc:creator>Shantaram Sahyadri</dc:creator>
      <dc:date>2005-02-01T03:24:31Z</dc:date>
    </item>
    <item>
      <title>Re: grep command acts stupid</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/grep-command-acts-stupid/m-p/4882865#M846748</link>
      <description>&amp;gt; here is the line as it is in the script&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&amp;gt;GREP=/usr/bin/grep&lt;BR /&gt;&amp;gt;set -x&lt;BR /&gt;&amp;gt;ps -eaf | $GREP -i -e armserver -e arraymod | grep -v grep&lt;BR /&gt;&amp;gt;set +x&lt;BR /&gt;&lt;BR /&gt;Two comments on this: &lt;BR /&gt;Firstly, you're using $GREP for one call, and just 'grep' for the other, not $GREP for both as suggested in an earlier response.  As others have suggested, we'd need to see the path for 'grep' within the script.&lt;BR /&gt;&lt;BR /&gt;Secondly, what is the output when you run this - what does the -x output show for this line?&lt;BR /&gt;&lt;BR /&gt;Andrew&lt;BR /&gt;</description>
      <pubDate>Tue, 01 Feb 2005 07:17:36 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/grep-command-acts-stupid/m-p/4882865#M846748</guid>
      <dc:creator>Andrew Merritt_2</dc:creator>
      <dc:date>2005-02-01T07:17:36Z</dc:date>
    </item>
    <item>
      <title>Re: grep command acts stupid</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/grep-command-acts-stupid/m-p/4882866#M846749</link>
      <description>The what+which indicates you have the correct grep command.&lt;BR /&gt;&lt;BR /&gt;Try this at the COMMAND LINE:&lt;BR /&gt;&lt;BR /&gt;GREP=/usr/bin/grep&lt;BR /&gt;ps -eaf | ${GREP} -i -e armserver -e arraymod | ${GREP} -v grep&lt;BR /&gt;&lt;BR /&gt;live free or die&lt;BR /&gt;harry d brown jr</description>
      <pubDate>Tue, 01 Feb 2005 08:09:45 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/grep-command-acts-stupid/m-p/4882866#M846749</guid>
      <dc:creator>harry d brown jr</dc:creator>
      <dc:date>2005-02-01T08:09:45Z</dc:date>
    </item>
    <item>
      <title>Re: grep command acts stupid</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/grep-command-acts-stupid/m-p/4882867#M846750</link>
      <description>Hi,&lt;BR /&gt;you stated in an earlier post that you tried using the UNIX95 option. Can you confirm that UNIX95 is not set in you script? I have the idea that setting this variable may - in connection with executing ps - cause some disturbance as to what may be considered options to the ps command(!).&lt;BR /&gt;Just an idea, but try inserting:&lt;BR /&gt;unset UNIX95&lt;BR /&gt;just before the grep command.&lt;BR /&gt; &lt;BR /&gt;regards,&lt;BR /&gt;John K,</description>
      <pubDate>Tue, 01 Feb 2005 08:11:24 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/grep-command-acts-stupid/m-p/4882867#M846750</guid>
      <dc:creator>john korterman</dc:creator>
      <dc:date>2005-02-01T08:11:24Z</dc:date>
    </item>
    <item>
      <title>Re: grep command acts stupid</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/grep-command-acts-stupid/m-p/4882868#M846751</link>
      <description>John,&lt;BR /&gt;&lt;BR /&gt;UNIX95 influences ps but I found not reference to an influence in grep.&lt;BR /&gt;&lt;BR /&gt;Michael&lt;BR /&gt;</description>
      <pubDate>Tue, 01 Feb 2005 09:40:56 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/grep-command-acts-stupid/m-p/4882868#M846751</guid>
      <dc:creator>Michael Schulte zur Sur</dc:creator>
      <dc:date>2005-02-01T09:40:56Z</dc:date>
    </item>
  </channel>
</rss>

