<?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 acting different between HPUX 10.20 and HPUX 11.11 in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/grep-acting-different-between-hpux-10-20-and-hpux-11-11/m-p/3132968#M799564</link>
    <description>Well, the most straightforward way to do this would be to copy the 10.20 version of grep to /usr/bin/ogrep (or something similar) on the 11.11 box. The converse (11.11 to 10.20 cannot be done).&lt;BR /&gt;&lt;BR /&gt;</description>
    <pubDate>Mon, 01 Dec 2003 16:12:24 GMT</pubDate>
    <dc:creator>A. Clay Stephenson</dc:creator>
    <dc:date>2003-12-01T16:12:24Z</dc:date>
    <item>
      <title>Grep acting different between HPUX 10.20 and HPUX 11.11</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/grep-acting-different-between-hpux-10-20-and-hpux-11-11/m-p/3132966#M799562</link>
      <description>Ok, I have a application file that is coming from DOS and grep is treating it differently between HPUX 10.20 and HPUX 11.11.  The DOS file is created from a third party application and I was told I could not modify the file!!  (Believe me I have tried to get the app team to understand that would be the easiest solution!)  The file ends without a newline character so if you cat the file both 10.20 and 11.i will print the output and then append the command prompt after that.  This is the same format for the output with 10.20, however, with 11.i it inserts a newline for you so the output from the grep is separate from the command prompt.  Here is what how the output looks.&lt;BR /&gt;########### HPUX 10.20 ############## &lt;BR /&gt;dev1:/tmp&amp;gt;cat me5&lt;BR /&gt;helloappdev1:/tmp&amp;gt;&lt;BR /&gt;&lt;BR /&gt;dev1:/tmp&amp;gt;grep lo me5&lt;BR /&gt;helloappdev1:/tmp&amp;gt;&lt;BR /&gt;&lt;BR /&gt;############### HPUX 11.i ############ &lt;BR /&gt;dev2:/tmp&amp;gt;cat me5&lt;BR /&gt;hellodv1csite:/tmp&amp;gt;&lt;BR /&gt;&lt;BR /&gt;dev2:/tmp&amp;gt;grep lo me5&lt;BR /&gt;hello&lt;BR /&gt;dv1csite:/tmp&amp;gt;&lt;BR /&gt;&lt;BR /&gt;I was wondering if anyone knows how to make the grep functionality act consistant (does matter which way the output looks as long as 10.20 and 11.i are consistant).  Like I said they will not let me modify the input file before the grep.  I also suggested using a Perl one liner "perl -ne 'print if /&lt;STRING&gt;/' filename.  The application team did not like that idea either.  &lt;BR /&gt;Please advise, if you have any suggestions for regular expersion for the grep command or ways to remove any/all DOS (or other) formating charaters from a line.  Or if you have similair problem and your solution (patch etc...)&lt;BR /&gt;P.S.  If you want to try this on your systems create a text file on Windows/DOS with notepad and FTP to 10.20 and 11.i servers.  Do not have a return at the end of the last line.&lt;BR /&gt;&lt;BR /&gt;Thanks!!!!!!&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/STRING&gt;</description>
      <pubDate>Mon, 01 Dec 2003 16:07:19 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/grep-acting-different-between-hpux-10-20-and-hpux-11-11/m-p/3132966#M799562</guid>
      <dc:creator>Tony Kuehn</dc:creator>
      <dc:date>2003-12-01T16:07:19Z</dc:date>
    </item>
    <item>
      <title>Re: Grep acting different between HPUX 10.20 and HPUX 11.11</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/grep-acting-different-between-hpux-10-20-and-hpux-11-11/m-p/3132967#M799563</link>
      <description>grep is pretty basic and was probably not intentionally modified by the OS.&lt;BR /&gt;&lt;BR /&gt;I'd check for patches, both 10.20 and 11.11 and see if there is anything for grep&lt;BR /&gt;&lt;BR /&gt;SEP</description>
      <pubDate>Mon, 01 Dec 2003 16:12:03 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/grep-acting-different-between-hpux-10-20-and-hpux-11-11/m-p/3132967#M799563</guid>
      <dc:creator>Steven E. Protter</dc:creator>
      <dc:date>2003-12-01T16:12:03Z</dc:date>
    </item>
    <item>
      <title>Re: Grep acting different between HPUX 10.20 and HPUX 11.11</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/grep-acting-different-between-hpux-10-20-and-hpux-11-11/m-p/3132968#M799564</link>
      <description>Well, the most straightforward way to do this would be to copy the 10.20 version of grep to /usr/bin/ogrep (or something similar) on the 11.11 box. The converse (11.11 to 10.20 cannot be done).&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Mon, 01 Dec 2003 16:12:24 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/grep-acting-different-between-hpux-10-20-and-hpux-11-11/m-p/3132968#M799564</guid>
      <dc:creator>A. Clay Stephenson</dc:creator>
      <dc:date>2003-12-01T16:12:24Z</dc:date>
    </item>
    <item>
      <title>Re: Grep acting different between HPUX 10.20 and HPUX 11.11</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/grep-acting-different-between-hpux-10-20-and-hpux-11-11/m-p/3132969#M799565</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;Have you tried using the 'dos2ux' command on the file?  Even if they won't let you modify it maybe you could use it to create a temporary file to use for your grep?&lt;BR /&gt;&lt;BR /&gt;Just an idea.&lt;BR /&gt;&lt;BR /&gt;JP&lt;BR /&gt;</description>
      <pubDate>Mon, 01 Dec 2003 16:14:23 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/grep-acting-different-between-hpux-10-20-and-hpux-11-11/m-p/3132969#M799565</guid>
      <dc:creator>John Poff</dc:creator>
      <dc:date>2003-12-01T16:14:23Z</dc:date>
    </item>
    <item>
      <title>Re: Grep acting different between HPUX 10.20 and HPUX 11.11</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/grep-acting-different-between-hpux-10-20-and-hpux-11-11/m-p/3132970#M799566</link>
      <description>grep performs no formatting at all. It prints a line of text exactly as the line appears in the document. The assumption is that each line is alpha-numeric, terminated by a newline character (LF) and there are no binary control characters in the file. Now the real problem is that you (and the app developers) are trying to mix two completely different operating systems together, expecting their file formats to be the same, a very bad assumption. &lt;BR /&gt; &lt;BR /&gt;A PC-based text file is:&lt;BR /&gt; &lt;BR /&gt;text CR LF&lt;BR /&gt;more text CR LF&lt;BR /&gt;last line CR LF&lt;BR /&gt;CTRL-Z&lt;BR /&gt; &lt;BR /&gt;but Unix text files are:&lt;BR /&gt; &lt;BR /&gt;text LF&lt;BR /&gt;more text LF&lt;BR /&gt;last line LF&lt;BR /&gt;NUL&lt;BR /&gt; &lt;BR /&gt;So the first question is: how did the file get from a PC to Unix? By ftp (then use the ASCII option when transferring), or by filesystem sharing as in SAMBA? If the latter, you will *always* have formatting issues because the two systems (PC and Unix) use different tools for the creation of the files and representation of the data. There is no reason to expect them to be compatible at all. However, HP-UX recognized this problem a long time ago, and provides bi-directional converter tools (dos2ux and ux2dos) to handle the differences.&lt;BR /&gt; &lt;BR /&gt;As for the inconsistent behavior, this is a typical corner case that is undefined between versions of grep and there is no special option to add a newline if the last line contains CTRL-Z and no CR+LF pair. So you'll have to translate the file before using grep (which is sort of a special option):&lt;BR /&gt; &lt;BR /&gt;dos2ux pc_file_name | grep &lt;OPTIONS&gt; &lt;BR /&gt; &lt;BR /&gt;Most likely this will standardize the file format and should produce the same result on both HP-UX systems.&lt;BR /&gt; &lt;BR /&gt;If not, grep was never designed as a formatting tool and a regular expression does not perform formatting, it is used only for pattern matching. With enough perl or awk code, you could probably make it work but the real issue is expecting internal data formats to be the same with foreign systems. That's why there is an ASCII option in ftp.&lt;/OPTIONS&gt;</description>
      <pubDate>Mon, 01 Dec 2003 17:05:46 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/grep-acting-different-between-hpux-10-20-and-hpux-11-11/m-p/3132970#M799566</guid>
      <dc:creator>Bill Hassell</dc:creator>
      <dc:date>2003-12-01T17:05:46Z</dc:date>
    </item>
    <item>
      <title>Re: Grep acting different between HPUX 10.20 and HPUX 11.11</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/grep-acting-different-between-hpux-10-20-and-hpux-11-11/m-p/3132971#M799567</link>
      <description>Are you sure there are no `strange' characters in the file, like escapes, returns or newlines?&lt;BR /&gt;&lt;BR /&gt;# od -x me5&lt;BR /&gt;&lt;BR /&gt;And are the versions of grep comparable? iow, are you using HP's version of grep on both sides, or is either version GNU grep, behaving differently&lt;BR /&gt;&lt;BR /&gt;# grep -V&lt;BR /&gt;&lt;BR /&gt;GNU grep will return the version, HP's grep will return a usage message&lt;BR /&gt;&lt;BR /&gt;Enjoy, Have FUN! H.Merijn</description>
      <pubDate>Mon, 01 Dec 2003 17:08:55 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/grep-acting-different-between-hpux-10-20-and-hpux-11-11/m-p/3132971#M799567</guid>
      <dc:creator>H.Merijn Brand (procura</dc:creator>
      <dc:date>2003-12-01T17:08:55Z</dc:date>
    </item>
    <item>
      <title>Re: Grep acting different between HPUX 10.20 and HPUX 11.11</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/grep-acting-different-between-hpux-10-20-and-hpux-11-11/m-p/3132972#M799568</link>
      <description>Sorry, I forgot to mention that I did try dos2ux and this does not seem to help the problem.  (I thought that would be answer, too!!)  The file systems are "shared" via ASU so the application team does not transfer the files via ftp/sfpt.&lt;BR /&gt;I was able to copy a 10.20 grep binary and put it it /usr/bin/ as 1020grep and then put in alias in the users profile for grep to ran 1020grep (as this is what they wanted).  Thanks for all your help/suggestions!!!!!</description>
      <pubDate>Mon, 01 Dec 2003 17:15:52 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/grep-acting-different-between-hpux-10-20-and-hpux-11-11/m-p/3132972#M799568</guid>
      <dc:creator>Tony Kuehn</dc:creator>
      <dc:date>2003-12-01T17:15:52Z</dc:date>
    </item>
  </channel>
</rss>

