<?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 working differently in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/grep-working-differently/m-p/4575886#M650490</link>
    <description>&lt;!--!*#--&gt;&amp;gt; please help me out.&lt;BR /&gt;&lt;BR /&gt;You first.&lt;BR /&gt;&lt;BR /&gt;&amp;gt; but in our main directory it returns null&lt;BR /&gt;&amp;gt; since it tries to grep like 'grep 0 1'&lt;BR /&gt;&lt;BR /&gt;How did you decide this?  What do you get if&lt;BR /&gt;you leave off the "grep [...]"?  That is,&lt;BR /&gt;what gets fed into the "grep" command?</description>
    <pubDate>Tue, 02 Feb 2010 07:55:42 GMT</pubDate>
    <dc:creator>Steven Schweda</dc:creator>
    <dc:date>2010-02-02T07:55:42Z</dc:date>
    <item>
      <title>grep working differently</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/grep-working-differently/m-p/4575885#M650489</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;I am trying to connect oracle and get a date by using &lt;BR /&gt;&lt;BR /&gt;YESDATE=`echo "select to_char(to_date('20100130', 'YYYYMMDD') - 1, 'YYYYMMDD') from dual;" | sqlplus -s ${CONNECT_STR}  | grep [0-9]`&lt;BR /&gt;&lt;BR /&gt;In my home directory it returns 20100129&lt;BR /&gt;&lt;BR /&gt;but in our main directory it returns null since it tries to grep like 'grep 0 1'&lt;BR /&gt;&lt;BR /&gt;Wonder why it grep like this instead of [0-9]&lt;BR /&gt;&lt;BR /&gt;please help me out.&lt;BR /&gt;&lt;BR /&gt;-Mayil</description>
      <pubDate>Tue, 02 Feb 2010 06:42:54 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/grep-working-differently/m-p/4575885#M650489</guid>
      <dc:creator>MAYIANAN</dc:creator>
      <dc:date>2010-02-02T06:42:54Z</dc:date>
    </item>
    <item>
      <title>Re: grep working differently</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/grep-working-differently/m-p/4575886#M650490</link>
      <description>&lt;!--!*#--&gt;&amp;gt; please help me out.&lt;BR /&gt;&lt;BR /&gt;You first.&lt;BR /&gt;&lt;BR /&gt;&amp;gt; but in our main directory it returns null&lt;BR /&gt;&amp;gt; since it tries to grep like 'grep 0 1'&lt;BR /&gt;&lt;BR /&gt;How did you decide this?  What do you get if&lt;BR /&gt;you leave off the "grep [...]"?  That is,&lt;BR /&gt;what gets fed into the "grep" command?</description>
      <pubDate>Tue, 02 Feb 2010 07:55:42 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/grep-working-differently/m-p/4575886#M650490</guid>
      <dc:creator>Steven Schweda</dc:creator>
      <dc:date>2010-02-02T07:55:42Z</dc:date>
    </item>
    <item>
      <title>Re: grep working differently</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/grep-working-differently/m-p/4575887#M650491</link>
      <description>In the statement i have hardcoded the date, means some number is passed to the grep but still it returns null.&lt;BR /&gt;&lt;BR /&gt;I tried this in command line&lt;BR /&gt;"echo "12string"|grep [0-9]"&lt;BR /&gt;&lt;BR /&gt;It returns 12string in my home directory&lt;BR /&gt;but nothing when i do the same in main directory.</description>
      <pubDate>Tue, 02 Feb 2010 10:03:58 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/grep-working-differently/m-p/4575887#M650491</guid>
      <dc:creator>MAYIANAN</dc:creator>
      <dc:date>2010-02-02T10:03:58Z</dc:date>
    </item>
    <item>
      <title>Re: grep working differently</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/grep-working-differently/m-p/4575888#M650492</link>
      <description>Hi,&lt;BR /&gt;What is for you the MAIN directory? If I were you I will check for environment variables to troubleshoot&lt;BR /&gt;# env in main and home directory&lt;BR /&gt;# whereis grep or which grep&lt;BR /&gt;After that get the location path of grep and test another time&lt;BR /&gt;# /usr/bin/grep&lt;BR /&gt;HTH</description>
      <pubDate>Tue, 02 Feb 2010 10:08:37 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/grep-working-differently/m-p/4575888#M650492</guid>
      <dc:creator>smatador</dc:creator>
      <dc:date>2010-02-02T10:08:37Z</dc:date>
    </item>
    <item>
      <title>Re: grep working differently</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/grep-working-differently/m-p/4575889#M650493</link>
      <description>&amp;gt;YESDATE=`echo "select to_char(to_date('20100130', 'YYYYMMDD') - 1, 'YYYYMMDD') from dual;" | sqlplus -s ${CONNECT_STR} | grep [0-9]`&lt;BR /&gt;&amp;gt;in our main directory it returns null since it tries to grep like 'grep 0 1'&lt;BR /&gt;&amp;gt;Wonder why it grep like this instead of [0-9]&lt;BR /&gt;&lt;BR /&gt;You haven't quoted it correctly, nor used $():&lt;BR /&gt;YESDATE=$(echo "select to_char(to_date('20100130', 'YYYYMMDD') - 1, 'YYYYMMDD') from dual;" | sqlplus -s ${CONNECT_STR} | grep "[0-9]")&lt;BR /&gt;&lt;BR /&gt;In particular do the following in both directories:&lt;BR /&gt;echo "[0-9]"&lt;BR /&gt;echo [0-9]&lt;BR /&gt;&lt;BR /&gt;&amp;gt;It returns 12string in my home directory but nothing when I do the same in main directory.&lt;BR /&gt;&lt;BR /&gt;If you use tusc, you can see exactly what grep sees.  And how the shell stabs you in the back.  :-)&lt;BR /&gt;&lt;BR /&gt;&amp;gt;Steven:  &amp;gt;&amp;gt;grep like 'grep 0 1'&lt;BR /&gt;&amp;gt;How did you decide this?&lt;BR /&gt;&lt;BR /&gt;That would be good to know.  Either Mayil used tusc or Mayil is very clever on analyzing and providing test output.&lt;BR /&gt;&lt;BR /&gt;In any case, it tells me a possible solution.</description>
      <pubDate>Tue, 02 Feb 2010 12:15:16 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/grep-working-differently/m-p/4575889#M650493</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2010-02-02T12:15:16Z</dc:date>
    </item>
  </channel>
</rss>

