<?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 Shell script to check lines? in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/shell-script-to-check-lines/m-p/4796262#M641453</link>
    <description>Can someone help to transform the below logic into a shell script, might be easy for some of you.&lt;BR /&gt;&lt;BR /&gt;I have a file with below text, I need if the line has the ":" and the above to it is not a blank line should print " &lt;TEXT&gt;: is incorrect format"&lt;BR /&gt;&lt;BR /&gt;Apple:&lt;BR /&gt;vitamin = A&lt;BR /&gt;Banana:&lt;BR /&gt;vitamin = A&lt;BR /&gt;&lt;BR /&gt;Orange:&lt;BR /&gt;vitamin = C&lt;BR /&gt;&lt;BR /&gt;So, If I run the script on above file, it should say Banana: is not a correct format&lt;/TEXT&gt;</description>
    <pubDate>Tue, 07 Jun 2011 09:09:57 GMT</pubDate>
    <dc:creator>lpuname</dc:creator>
    <dc:date>2011-06-07T09:09:57Z</dc:date>
    <item>
      <title>Shell script to check lines?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/shell-script-to-check-lines/m-p/4796262#M641453</link>
      <description>Can someone help to transform the below logic into a shell script, might be easy for some of you.&lt;BR /&gt;&lt;BR /&gt;I have a file with below text, I need if the line has the ":" and the above to it is not a blank line should print " &lt;TEXT&gt;: is incorrect format"&lt;BR /&gt;&lt;BR /&gt;Apple:&lt;BR /&gt;vitamin = A&lt;BR /&gt;Banana:&lt;BR /&gt;vitamin = A&lt;BR /&gt;&lt;BR /&gt;Orange:&lt;BR /&gt;vitamin = C&lt;BR /&gt;&lt;BR /&gt;So, If I run the script on above file, it should say Banana: is not a correct format&lt;/TEXT&gt;</description>
      <pubDate>Tue, 07 Jun 2011 09:09:57 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/shell-script-to-check-lines/m-p/4796262#M641453</guid>
      <dc:creator>lpuname</dc:creator>
      <dc:date>2011-06-07T09:09:57Z</dc:date>
    </item>
    <item>
      <title>Re: Shell script to check lines?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/shell-script-to-check-lines/m-p/4796263#M641454</link>
      <description>This works for me:&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;awk '/:/ &amp;amp;&amp;amp; stuff {print $0 "" Bad Format""} {stuff = NF}' test.txt&lt;BR /&gt;&lt;BR /&gt;Cheers,&lt;BR /&gt;Hein&lt;BR /&gt;</description>
      <pubDate>Tue, 07 Jun 2011 10:21:04 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/shell-script-to-check-lines/m-p/4796263#M641454</guid>
      <dc:creator>Hein van den Heuvel</dc:creator>
      <dc:date>2011-06-07T10:21:04Z</dc:date>
    </item>
    <item>
      <title>Re: Shell script to check lines?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/shell-script-to-check-lines/m-p/4796264#M641455</link>
      <description>It does work on the above data file but I tried it with this data:&lt;BR /&gt;&lt;BR /&gt;Apple:     vitamin = A&lt;BR /&gt;Banana:    vitamin = A&lt;BR /&gt;&lt;BR /&gt;Orange:    vitamin = C&lt;BR /&gt;Tangerine: vitamin = C&lt;BR /&gt;&lt;BR /&gt;It reports both Banana and Tangerine as having bad format.&lt;BR /&gt;&lt;BR /&gt;As written it is good as a pass/fail test but if you're trying to collect a list of all the errors it may need to be amended.&lt;BR /&gt;&lt;BR /&gt;Just FYI.</description>
      <pubDate>Wed, 08 Jun 2011 12:04:16 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/shell-script-to-check-lines/m-p/4796264#M641455</guid>
      <dc:creator>Fred Martin_1</dc:creator>
      <dc:date>2011-06-08T12:04:16Z</dc:date>
    </item>
    <item>
      <title>Re: Shell script to check lines?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/shell-script-to-check-lines/m-p/4796265#M641456</link>
      <description>Sorry, copy and paster error, in my test the data was formatted correctly as the author had shown.&lt;BR /&gt;</description>
      <pubDate>Wed, 08 Jun 2011 12:05:27 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/shell-script-to-check-lines/m-p/4796265#M641456</guid>
      <dc:creator>Fred Martin_1</dc:creator>
      <dc:date>2011-06-08T12:05:27Z</dc:date>
    </item>
  </channel>
</rss>

