<?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: search pattern issue in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/search-pattern-issue/m-p/4690972#M658967</link>
    <description>Horia,&lt;BR /&gt;&lt;BR /&gt;m/ stand for match , but seems useless somehow here, I tried without m like this:&lt;BR /&gt;if ( $line =~ /\b$line/ )&lt;BR /&gt;&lt;BR /&gt;it worked now.&lt;BR /&gt;&lt;BR /&gt;thanks</description>
    <pubDate>Fri, 24 Sep 2010 05:40:52 GMT</pubDate>
    <dc:creator>Hakki Aydin Ucar</dc:creator>
    <dc:date>2010-09-24T05:40:52Z</dc:date>
    <item>
      <title>search pattern issue</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/search-pattern-issue/m-p/4690969#M658964</link>
      <description>The following code clause does not find what it was supposed to be; pattern returns everything in file /tmp/UserLogin. What am I missing , any advice ?&lt;BR /&gt;&lt;BR /&gt;@users=`cat /etc/passwd|awk -F: '{print \$1}'`;&lt;BR /&gt;my $K;&lt;BR /&gt; for ( $K = 1; $K &amp;lt;= @users; $K++ )&lt;BR /&gt; {&lt;BR /&gt; open(IN,"/tmp/UserLogin");&lt;BR /&gt; open(OUT,"&amp;gt;&amp;gt;/tmp/LogonOutput");&lt;BR /&gt; while ($line=&lt;IN&gt;) {&lt;BR /&gt; $pattern = "$users[$K-1]" ;&lt;BR /&gt; if ( $line =~ m{$pattern} ) {&lt;BR /&gt; print "$pattern equal to $line\n";&lt;BR /&gt; print OUT "$line\n";&lt;BR /&gt;}&lt;BR /&gt;}&lt;BR /&gt; }&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Besides,&lt;BR /&gt;I tried m/\b$pattern/ also ,but it did  not work at all.&lt;/IN&gt;</description>
      <pubDate>Fri, 24 Sep 2010 05:01:30 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/search-pattern-issue/m-p/4690969#M658964</guid>
      <dc:creator>Hakki Aydin Ucar</dc:creator>
      <dc:date>2010-09-24T05:01:30Z</dc:date>
    </item>
    <item>
      <title>Re: search pattern issue</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/search-pattern-issue/m-p/4690970#M658965</link>
      <description>Hello, &lt;BR /&gt;&lt;BR /&gt;Why m/ ? (Multiple lines?) you only read one line at at a time, so should use s/&lt;BR /&gt;&lt;BR /&gt;Best regards&lt;BR /&gt;Horia.</description>
      <pubDate>Fri, 24 Sep 2010 05:27:01 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/search-pattern-issue/m-p/4690970#M658965</guid>
      <dc:creator>Horia Chirculescu</dc:creator>
      <dc:date>2010-09-24T05:27:01Z</dc:date>
    </item>
    <item>
      <title>Re: search pattern issue</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/search-pattern-issue/m-p/4690971#M658966</link>
      <description>Seems that default is single line... Sorry.</description>
      <pubDate>Fri, 24 Sep 2010 05:30:28 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/search-pattern-issue/m-p/4690971#M658966</guid>
      <dc:creator>Horia Chirculescu</dc:creator>
      <dc:date>2010-09-24T05:30:28Z</dc:date>
    </item>
    <item>
      <title>Re: search pattern issue</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/search-pattern-issue/m-p/4690972#M658967</link>
      <description>Horia,&lt;BR /&gt;&lt;BR /&gt;m/ stand for match , but seems useless somehow here, I tried without m like this:&lt;BR /&gt;if ( $line =~ /\b$line/ )&lt;BR /&gt;&lt;BR /&gt;it worked now.&lt;BR /&gt;&lt;BR /&gt;thanks</description>
      <pubDate>Fri, 24 Sep 2010 05:40:52 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/search-pattern-issue/m-p/4690972#M658967</guid>
      <dc:creator>Hakki Aydin Ucar</dc:creator>
      <dc:date>2010-09-24T05:40:52Z</dc:date>
    </item>
    <item>
      <title>Re: search pattern issue</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/search-pattern-issue/m-p/4690973#M658968</link>
      <description>Ohhh.. One mistake:&lt;BR /&gt;&lt;BR /&gt;Move &lt;BR /&gt;&lt;BR /&gt;open(IN,"/tmp/UserLogin");&lt;BR /&gt;open(OUT,"&amp;gt;&amp;gt;/tmp/LogonOutput");&lt;BR /&gt;&lt;BR /&gt;outside for ! You actually read the same data a lot of times...&lt;BR /&gt;&lt;BR /&gt;Horai&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Fri, 24 Sep 2010 05:41:47 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/search-pattern-issue/m-p/4690973#M658968</guid>
      <dc:creator>Horia Chirculescu</dc:creator>
      <dc:date>2010-09-24T05:41:47Z</dc:date>
    </item>
    <item>
      <title>Re: search pattern issue</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/search-pattern-issue/m-p/4690974#M658969</link>
      <description>And... When done, you should close the files&lt;BR /&gt;&lt;BR /&gt;close(IN)&lt;BR /&gt;close(OUT)&lt;BR /&gt;&lt;BR /&gt;Best regards,&lt;BR /&gt;Horia.</description>
      <pubDate>Fri, 24 Sep 2010 05:42:59 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/search-pattern-issue/m-p/4690974#M658969</guid>
      <dc:creator>Horia Chirculescu</dc:creator>
      <dc:date>2010-09-24T05:42:59Z</dc:date>
    </item>
    <item>
      <title>Re: search pattern issue</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/search-pattern-issue/m-p/4690975#M658970</link>
      <description>$line =~ /\b$line/ and it worked?!&lt;BR /&gt;&lt;BR /&gt;Meaning $line was searched for $line?</description>
      <pubDate>Fri, 24 Sep 2010 05:50:14 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/search-pattern-issue/m-p/4690975#M658970</guid>
      <dc:creator>Horia Chirculescu</dc:creator>
      <dc:date>2010-09-24T05:50:14Z</dc:date>
    </item>
    <item>
      <title>Re: search pattern issue</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/search-pattern-issue/m-p/4690976#M658971</link>
      <description>&amp;gt;Horia:$line =~ /\b$line/ and it worked?!&lt;BR /&gt;&lt;BR /&gt;Meaning $line was searched for $line?&lt;BR /&gt;&lt;BR /&gt;Right, it is mistake, I just noticed that put OPEN File handler out of for loop, but I am still unable to pick from file what I wanted.</description>
      <pubDate>Fri, 24 Sep 2010 06:01:52 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/search-pattern-issue/m-p/4690976#M658971</guid>
      <dc:creator>Hakki Aydin Ucar</dc:creator>
      <dc:date>2010-09-24T06:01:52Z</dc:date>
    </item>
    <item>
      <title>Re: search pattern issue</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/search-pattern-issue/m-p/4690977#M658972</link>
      <description>Try&lt;BR /&gt;&lt;BR /&gt;($line =~ m/$pattern{0}/ )&lt;BR /&gt;&lt;BR /&gt;Horia.</description>
      <pubDate>Fri, 24 Sep 2010 07:08:26 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/search-pattern-issue/m-p/4690977#M658972</guid>
      <dc:creator>Horia Chirculescu</dc:creator>
      <dc:date>2010-09-24T07:08:26Z</dc:date>
    </item>
    <item>
      <title>Re: search pattern issue</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/search-pattern-issue/m-p/4690978#M658973</link>
      <description>&lt;!--!*#--&gt;@users=`cat /etc/passwd|awk -F: '{print \$1}'`;&lt;BR /&gt;my $K;&lt;BR /&gt;#open(IN,"/tmp/UserLogin");&lt;BR /&gt;open(OUT,"&amp;gt;&amp;gt;/tmp/LogonOutput");&lt;BR /&gt;&lt;BR /&gt;for ( $K = 1; $K &amp;lt;= @users; $K++ )&lt;BR /&gt;{&lt;BR /&gt;open(IN,"/tmp/UserLogin");&lt;BR /&gt;&lt;BR /&gt;while ($line=&lt;IN&gt;)&lt;BR /&gt; {&lt;BR /&gt;$pattern = "$users[$K-1]" ;&lt;BR /&gt;&lt;BR /&gt;if ( $line =~ m/$pattern{0}/ ) {&lt;BR /&gt;print "$pattern equal to $line\n";&lt;BR /&gt;print OUT "$line\n";&lt;BR /&gt;   }&lt;BR /&gt; }&lt;BR /&gt;&lt;BR /&gt;close(IN);&lt;BR /&gt;&lt;BR /&gt;}&lt;BR /&gt;&lt;/IN&gt;</description>
      <pubDate>Fri, 24 Sep 2010 07:10:35 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/search-pattern-issue/m-p/4690978#M658973</guid>
      <dc:creator>Horia Chirculescu</dc:creator>
      <dc:date>2010-09-24T07:10:35Z</dc:date>
    </item>
    <item>
      <title>Re: search pattern issue</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/search-pattern-issue/m-p/4690979#M658974</link>
      <description>&amp;gt;Horia: ($line =~ m/$pattern{0}/ )&lt;BR /&gt;&lt;BR /&gt;only the first pattern working, others not working, problem is why perl picks up all pattern they are not even on the $pattern values ?&lt;BR /&gt;&lt;BR /&gt;Regards,</description>
      <pubDate>Fri, 24 Sep 2010 07:26:46 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/search-pattern-issue/m-p/4690979#M658974</guid>
      <dc:creator>Hakki Aydin Ucar</dc:creator>
      <dc:date>2010-09-24T07:26:46Z</dc:date>
    </item>
    <item>
      <title>Re: search pattern issue</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/search-pattern-issue/m-p/4690980#M658975</link>
      <description>Sorry for points assigned in reverse posts but all belongs to you eventually.&lt;BR /&gt;Thanks, the problem solved apparently now, but another problem ,if patterns don t match , still written into OUTPUT file ??&lt;BR /&gt;&lt;BR /&gt;is it weird ? something is missing in the loop ?</description>
      <pubDate>Fri, 24 Sep 2010 07:35:16 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/search-pattern-issue/m-p/4690980#M658975</guid>
      <dc:creator>Hakki Aydin Ucar</dc:creator>
      <dc:date>2010-09-24T07:35:16Z</dc:date>
    </item>
    <item>
      <title>Re: search pattern issue</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/search-pattern-issue/m-p/4690981#M658976</link>
      <description>There should be nothing in the output file if nothing to match...&lt;BR /&gt;&lt;BR /&gt;What exactly do you get in the output file in this case?&lt;BR /&gt;&lt;BR /&gt;Horia.</description>
      <pubDate>Fri, 24 Sep 2010 07:42:14 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/search-pattern-issue/m-p/4690981#M658976</guid>
      <dc:creator>Horia Chirculescu</dc:creator>
      <dc:date>2010-09-24T07:42:14Z</dc:date>
    </item>
    <item>
      <title>Re: search pattern issue</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/search-pattern-issue/m-p/4690982#M658977</link>
      <description>.. and do not forget to close (OUT) when exit for (not pasted in my example code)</description>
      <pubDate>Fri, 24 Sep 2010 07:45:33 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/search-pattern-issue/m-p/4690982#M658977</guid>
      <dc:creator>Horia Chirculescu</dc:creator>
      <dc:date>2010-09-24T07:45:33Z</dc:date>
    </item>
    <item>
      <title>Re: search pattern issue</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/search-pattern-issue/m-p/4690983#M658978</link>
      <description>&lt;!--!*#--&gt;#!/usr/bin/perl&lt;BR /&gt;@users=`cat /etc/passwd|awk -F: '{print \$1}'`;&lt;BR /&gt;my $K;&lt;BR /&gt;open(OUT,"&amp;gt;&amp;gt;/tmp/LogonOutput");&lt;BR /&gt;&lt;BR /&gt;for ( $K = 1; $K &amp;lt;= @users; $K++ )&lt;BR /&gt;{&lt;BR /&gt;open(IN,"/tmp/UserLogin");&lt;BR /&gt;while ($line=&lt;IN&gt;)&lt;BR /&gt; {&lt;BR /&gt;$pattern = "$users[$K-1]" ;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;if ( $line =~ m/$pattern{0}/ ) {&lt;BR /&gt;print "$pattern equal to $line\n";&lt;BR /&gt;print OUT "$line\n";&lt;BR /&gt;   }&lt;BR /&gt; }&lt;BR /&gt;close(IN);&lt;BR /&gt;&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;close(OUT);&lt;/IN&gt;</description>
      <pubDate>Fri, 24 Sep 2010 07:48:04 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/search-pattern-issue/m-p/4690983#M658978</guid>
      <dc:creator>Horia Chirculescu</dc:creator>
      <dc:date>2010-09-24T07:48:04Z</dc:date>
    </item>
    <item>
      <title>Re: search pattern issue</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/search-pattern-issue/m-p/4690984#M658979</link>
      <description>&amp;gt;Horia:There should be nothing in the output file if nothing to match...&lt;BR /&gt;What exactly do you get in the output file in this case?&lt;BR /&gt;&lt;BR /&gt;this is from output file:&lt;BR /&gt;LOGIN Sep 17 2010 18:03:09&lt;BR /&gt;root Sep 17 2010 18:03:24&lt;BR /&gt;student Sep 20 2010 13:55:45&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;LOGIN and root are not in the @users list but goes to output file ??</description>
      <pubDate>Fri, 24 Sep 2010 08:08:27 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/search-pattern-issue/m-p/4690984#M658979</guid>
      <dc:creator>Hakki Aydin Ucar</dc:creator>
      <dc:date>2010-09-24T08:08:27Z</dc:date>
    </item>
    <item>
      <title>Re: search pattern issue</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/search-pattern-issue/m-p/4690985#M658980</link>
      <description>Horia,&lt;BR /&gt;&lt;BR /&gt;I tried to change environment and seems its working now , so my test server has some problems by Perl sources ??&lt;BR /&gt;I will notify the solution after completed tests.&lt;BR /&gt;Thanks&lt;BR /&gt;Hakki</description>
      <pubDate>Fri, 24 Sep 2010 08:14:08 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/search-pattern-issue/m-p/4690985#M658980</guid>
      <dc:creator>Hakki Aydin Ucar</dc:creator>
      <dc:date>2010-09-24T08:14:08Z</dc:date>
    </item>
    <item>
      <title>Re: search pattern issue</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/search-pattern-issue/m-p/4690986#M658981</link>
      <description>I believe user "root" should be in /etc/passwd so will be present also in @users list. &lt;BR /&gt;&lt;BR /&gt;This could be true also for the "student" user.&lt;BR /&gt;&lt;BR /&gt;Looks strange the presence of LOGIN.&lt;BR /&gt;&lt;BR /&gt;grep LOGIN /etc/passwd?&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Can you attach the file /tmp/UserLogin ?&lt;BR /&gt;&lt;BR /&gt;Horia.&lt;BR /&gt;</description>
      <pubDate>Fri, 24 Sep 2010 08:17:53 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/search-pattern-issue/m-p/4690986#M658981</guid>
      <dc:creator>Horia Chirculescu</dc:creator>
      <dc:date>2010-09-24T08:17:53Z</dc:date>
    </item>
    <item>
      <title>Re: search pattern issue</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/search-pattern-issue/m-p/4690987#M658982</link>
      <description>&amp;gt;I tried to change environment&lt;BR /&gt;&lt;BR /&gt;What exactly did you changed in the env. ?&lt;BR /&gt;&lt;BR /&gt;Horia.</description>
      <pubDate>Fri, 24 Sep 2010 08:19:05 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/search-pattern-issue/m-p/4690987#M658982</guid>
      <dc:creator>Horia Chirculescu</dc:creator>
      <dc:date>2010-09-24T08:19:05Z</dc:date>
    </item>
    <item>
      <title>Re: search pattern issue</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/search-pattern-issue/m-p/4690988#M658983</link>
      <description>&amp;gt;Horia:I believe user "root" should be in /etc/passwd so will be present also in @users list. &lt;BR /&gt;&lt;BR /&gt;No, I took it out from passwd file with "grep -v"&lt;BR /&gt;&lt;BR /&gt;I meant another server with environment change. &lt;BR /&gt;&lt;BR /&gt;Last script is here (working great now!)&lt;BR /&gt;@users=`cat /etc/passwd|awk -F: '{print \$1}'|grep -vE 'root|nwauto|daemon|bin|sys|adm|uucp|lp|www|webadmi&lt;BR /&gt;n|hpdb|informix|nuucp|smbnull|mysql|nwcron|goglobal|alop|trop|dbadmin|c7op|sysadmin`;&lt;BR /&gt;my $K;&lt;BR /&gt;open(OUT,"&amp;gt;&amp;gt;/tmp/LogonOutput");&lt;BR /&gt;for ( $K = 1; $K &amp;lt;= @users; $K++ )&lt;BR /&gt;{&lt;BR /&gt;open(IN,"/tmp/UserLogin");&lt;BR /&gt;while ($line=&lt;IN&gt;)&lt;BR /&gt;{&lt;BR /&gt;$pattern = "$users[$K-1]" ;&lt;BR /&gt;if ( $line =~ m/\b$pattern{0}/ ) {&lt;BR /&gt;print "$pattern equal to $line\n";&lt;BR /&gt;print OUT "$line";&lt;BR /&gt;    }&lt;BR /&gt;   }&lt;BR /&gt;   close(IN);&lt;BR /&gt;   }&lt;BR /&gt;   close(OUT);&lt;BR /&gt;&lt;/IN&gt;</description>
      <pubDate>Fri, 24 Sep 2010 09:34:08 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/search-pattern-issue/m-p/4690988#M658983</guid>
      <dc:creator>Hakki Aydin Ucar</dc:creator>
      <dc:date>2010-09-24T09:34:08Z</dc:date>
    </item>
  </channel>
</rss>

