<?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: use multiple field seperators with awk in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/use-multiple-field-seperators-with-awk/m-p/4903106#M701871</link>
    <description>Dont' make it readable, if it works, leave it as is and make a really good comment how it works.&lt;BR /&gt;&lt;BR /&gt;Because when you try to rewrite things so they'll look simplier, you can put there some bugs.&lt;BR /&gt;&lt;BR /&gt;Good comment on this line will be enough I think :)</description>
    <pubDate>Fri, 20 May 2005 07:51:43 GMT</pubDate>
    <dc:creator>Alex Lavrov.</dc:creator>
    <dc:date>2005-05-20T07:51:43Z</dc:date>
    <item>
      <title>use multiple field seperators with awk</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/use-multiple-field-seperators-with-awk/m-p/4903101#M701866</link>
      <description>Hi all,&lt;BR /&gt;&lt;BR /&gt;In a testcase, my /etc/oratab looks like this:&lt;BR /&gt;# Oracle 8 stuff (ocho)&lt;BR /&gt;tst1:/mnt/u01/app/oracle/product/8.1.7:Y&lt;BR /&gt;# Oracle 9 stuff (el nino)&lt;BR /&gt;tst2:/mnt/u01/app/oracle/product/9.2.0:Y&lt;BR /&gt;tst3:/mnt/u01/app/oracle/product/9.2.0:N&lt;BR /&gt;&lt;BR /&gt;for a backup script I need all "active" Oracle 9i databases. I came up with this: &lt;BR /&gt;DBLIST=$(awk -F: '$1 !~ /^#/ &amp;amp;&amp;amp; $3 ~ /Y$/ {print $1}' ${ORATAB})&lt;BR /&gt;, but that does only filter the "Y" and comment lines. How can I filter the "9" (and 10 later on) out of the lines?&lt;BR /&gt;Best would be use something with &amp;gt;8 &lt;BR /&gt;&lt;BR /&gt;I'm struggling with split, but I'm stuck&lt;BR /&gt;Any ideas?&lt;BR /&gt;&lt;BR /&gt;Cheerio,&lt;BR /&gt;&lt;BR /&gt;Renarios&lt;BR /&gt;</description>
      <pubDate>Fri, 20 May 2005 04:36:50 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/use-multiple-field-seperators-with-awk/m-p/4903101#M701866</guid>
      <dc:creator>renarios</dc:creator>
      <dc:date>2005-05-20T04:36:50Z</dc:date>
    </item>
    <item>
      <title>Re: use multiple field seperators with awk</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/use-multiple-field-seperators-with-awk/m-p/4903102#M701867</link>
      <description>Hello,&lt;BR /&gt;&lt;BR /&gt;I just did what you have said....&lt;BR /&gt;&lt;BR /&gt;[rx260-11]/sudhi &amp;gt;cat kk&lt;BR /&gt;# Oracle 8 stuff (ocho)&lt;BR /&gt;tst1:/mnt/u01/app/oracle/product/8.1.7:Y&lt;BR /&gt;# Oracle 9 stuff (el nino)&lt;BR /&gt;tst2:/mnt/u01/app/oracle/product/9.2.0:Y&lt;BR /&gt;tst3:/mnt/u01/app/oracle/product/9.2.0:N&lt;BR /&gt;                                    &lt;BR /&gt;[rx260-11]/sudhi &amp;gt;awk -F: '$1 !~ /^#/ &amp;amp;&amp;amp; $3 ~ /Y$/ {print $1}' kk&lt;BR /&gt;tst1&lt;BR /&gt;tst2&lt;BR /&gt;[rx260-11]/sudhi &amp;gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;and see only test1,test2 in the o/p&lt;BR /&gt;&lt;BR /&gt;what you want to achive? am I missing something in your question?&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Sudeesh&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Fri, 20 May 2005 05:01:45 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/use-multiple-field-seperators-with-awk/m-p/4903102#M701867</guid>
      <dc:creator>Sudeesh</dc:creator>
      <dc:date>2005-05-20T05:01:45Z</dc:date>
    </item>
    <item>
      <title>Re: use multiple field seperators with awk</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/use-multiple-field-seperators-with-awk/m-p/4903103#M701868</link>
      <description>Hi Sudeesh,&lt;BR /&gt;&lt;BR /&gt;Thanks for the quick response.&lt;BR /&gt;The output should be only tst2, because tst1 is 8.1.7 and I only want the active 9.2.0 (or in future higher) databases.&lt;BR /&gt;&lt;BR /&gt;thanks,&lt;BR /&gt;&lt;BR /&gt;RenÃ</description>
      <pubDate>Fri, 20 May 2005 06:01:29 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/use-multiple-field-seperators-with-awk/m-p/4903103#M701868</guid>
      <dc:creator>renarios</dc:creator>
      <dc:date>2005-05-20T06:01:29Z</dc:date>
    </item>
    <item>
      <title>Re: use multiple field seperators with awk</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/use-multiple-field-seperators-with-awk/m-p/4903104#M701869</link>
      <description>Latest code is &lt;BR /&gt;awk -F: '$1 !~ /^#/ &amp;amp;&amp;amp; $3 ~ /Y$/ &amp;amp;&amp;amp; split($0, arr, "/") {if ( arr[7] &amp;gt; 8 ) print arr[7] "*" $1 " " $2 " " $3}' ${ORATAB}&lt;BR /&gt;, but it does not work.&lt;BR /&gt;&lt;BR /&gt;Has anyone other/ideas ideas?&lt;BR /&gt;&lt;BR /&gt;Cheers,&lt;BR /&gt;&lt;BR /&gt;Renarios</description>
      <pubDate>Fri, 20 May 2005 07:18:35 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/use-multiple-field-seperators-with-awk/m-p/4903104#M701869</guid>
      <dc:creator>renarios</dc:creator>
      <dc:date>2005-05-20T07:18:35Z</dc:date>
    </item>
    <item>
      <title>Re: use multiple field seperators with awk</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/use-multiple-field-seperators-with-awk/m-p/4903105#M701870</link>
      <description>I found a solution:&lt;BR /&gt;awk -F: '$1 !~ /^#/ &amp;amp;&amp;amp; $3 ~ /Y$/ &amp;amp;&amp;amp; split($0, arr, "/") &amp;amp;&amp;amp; split(arr[7], oraver, ".") {if ( oraver[1] &amp;gt;= 9 ) print $1}' ${ORATAB}&lt;BR /&gt;&lt;BR /&gt;10 point for Renarios?&lt;BR /&gt;&lt;BR /&gt;Only thing is: How do I get this readable?&lt;BR /&gt;If I use BEGIN and END, it doesn't work anymore. &lt;BR /&gt;Anyone ideas?&lt;BR /&gt;&lt;BR /&gt;Cheerio,&lt;BR /&gt;&lt;BR /&gt;Renarios</description>
      <pubDate>Fri, 20 May 2005 07:43:41 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/use-multiple-field-seperators-with-awk/m-p/4903105#M701870</guid>
      <dc:creator>renarios</dc:creator>
      <dc:date>2005-05-20T07:43:41Z</dc:date>
    </item>
    <item>
      <title>Re: use multiple field seperators with awk</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/use-multiple-field-seperators-with-awk/m-p/4903106#M701871</link>
      <description>Dont' make it readable, if it works, leave it as is and make a really good comment how it works.&lt;BR /&gt;&lt;BR /&gt;Because when you try to rewrite things so they'll look simplier, you can put there some bugs.&lt;BR /&gt;&lt;BR /&gt;Good comment on this line will be enough I think :)</description>
      <pubDate>Fri, 20 May 2005 07:51:43 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/use-multiple-field-seperators-with-awk/m-p/4903106#M701871</guid>
      <dc:creator>Alex Lavrov.</dc:creator>
      <dc:date>2005-05-20T07:51:43Z</dc:date>
    </item>
    <item>
      <title>Re: use multiple field seperators with awk</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/use-multiple-field-seperators-with-awk/m-p/4903107#M701872</link>
      <description>something a little more readable&lt;BR /&gt;&lt;BR /&gt;awk -F: '$1 !~ /^#/ &amp;amp;&amp;amp; $3 ~ /Y$/ {&lt;BR /&gt;split($0, arr, "/");&lt;BR /&gt;split(arr[7], oraver, ".");&lt;BR /&gt;if ( oraver[1] &amp;gt;= 9 ) print $1;&lt;BR /&gt;}' ${ORATAB}&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Fri, 20 May 2005 09:18:20 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/use-multiple-field-seperators-with-awk/m-p/4903107#M701872</guid>
      <dc:creator>curt larson_1</dc:creator>
      <dc:date>2005-05-20T09:18:20Z</dc:date>
    </item>
    <item>
      <title>Re: use multiple field seperators with awk</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/use-multiple-field-seperators-with-awk/m-p/4903108#M701873</link>
      <description>Thanks guys, &lt;BR /&gt;&lt;BR /&gt;That should do the trick. &lt;BR /&gt;Time for weekend. Have one on me.&lt;BR /&gt;&lt;BR /&gt;Solution: &lt;BR /&gt;    DBLIST=$( awk -F: '$1 !~ /^#/ &amp;amp;&amp;amp; $3 ~ /Y$/ {&lt;BR /&gt;    split($0, arr, "/");&lt;BR /&gt;    split(arr[7], oraver, ".");&lt;BR /&gt;    if ( oraver[1] &amp;gt;= 9 ) print $1;&lt;BR /&gt;    }' ${ORATAB} )&lt;BR /&gt;&lt;BR /&gt;Cheerio,&lt;BR /&gt;&lt;BR /&gt;Renarios</description>
      <pubDate>Fri, 20 May 2005 09:24:49 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/use-multiple-field-seperators-with-awk/m-p/4903108#M701873</guid>
      <dc:creator>renarios</dc:creator>
      <dc:date>2005-05-20T09:24:49Z</dc:date>
    </item>
  </channel>
</rss>

