<?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: parse a file with expressions (grep) in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/parse-a-file-with-expressions-grep/m-p/5257452#M659112</link>
    <description>&lt;!--!*#--&gt;&lt;BR /&gt;@ Where are your patterns? On the command line or in your test.cnf?&lt;BR /&gt;in the attachment script (test.sh)&lt;BR /&gt;&lt;BR /&gt;@ Do you want to have the command line or test.cnf have EREs? Or do you want an exact match with a special case of "*" in test.cnf?&lt;BR /&gt;i want it , if it easy to handle in test.cnf.&lt;BR /&gt;&lt;BR /&gt;sorry, it explained it very bad .&lt;BR /&gt;&lt;BR /&gt;what i mean :&lt;BR /&gt;&lt;BR /&gt;i want to make an entry in config-file with wildcard's? like :&lt;BR /&gt;&lt;BR /&gt;* * var&lt;BR /&gt;&lt;BR /&gt;and then i want to search with a statement all entry's field 1 and 2 and with exact value in field 3 (example : var)&lt;BR /&gt;&lt;BR /&gt;also i think it complicated to search entries with example&lt;BR /&gt;entry* entry* var &lt;BR /&gt;&lt;BR /&gt;but this i don't need for my case.&lt;BR /&gt;&lt;BR /&gt;in the meantime in think about following,&lt;BR /&gt;i create a placeholder or wildcard for "*" like "allmatches" and it is&lt;BR /&gt;easier to handle in statement's . example:&lt;BR /&gt;&lt;BR /&gt;allmatches allmatches var</description>
    <pubDate>Thu, 07 Oct 2010 10:19:55 GMT</pubDate>
    <dc:creator>Billa-User</dc:creator>
    <dc:date>2010-10-07T10:19:55Z</dc:date>
    <item>
      <title>parse a file with expressions (grep)</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/parse-a-file-with-expressions-grep/m-p/5257439#M659099</link>
      <description>&lt;!--!*#--&gt;hello,&lt;BR /&gt;&lt;BR /&gt;i have to change a existing shell script.&lt;BR /&gt;&lt;BR /&gt;here my issue:&lt;BR /&gt;&lt;BR /&gt;demo file (field separator &lt;BLANK&gt; or &lt;WHITESPACE&gt;): test.cnf&lt;BR /&gt;entry1 entry2&lt;BR /&gt;entry1 entry2 var&lt;BR /&gt;&lt;BR /&gt;shell script should find following:&lt;BR /&gt;search with : entry1 and  entry2 =&amp;gt; OK&lt;BR /&gt;              but should not find&lt;BR /&gt;              entry1 entry2 var&lt;BR /&gt;search with : entry1 and  entry2 and var =&amp;gt; OK&lt;BR /&gt;search with : entry1 and  entry2 and notvar =&amp;gt; Not-OK&lt;BR /&gt;&lt;BR /&gt;# shell script test.sh&lt;BR /&gt;# begin&lt;BR /&gt;# if doesn't work when field separator is &lt;WHITESPACE&gt;&lt;BR /&gt;entry1=$1&lt;BR /&gt;entry2=$2&lt;BR /&gt;&lt;BR /&gt;var=$3&lt;BR /&gt;&lt;BR /&gt;if grep "^[ \t]*${entry1}[ \t]" test.cnf &amp;gt;/dev/null&lt;BR /&gt;then&lt;BR /&gt;  if grep "^${entry1}[ \t]*${entry2}$" test.cnf  &amp;gt;/dev/null&lt;BR /&gt;  then&lt;BR /&gt;     if grep "^${entry1}[ \t]*${entry2}&lt;BR /&gt;[ \t]*${entry2}${var}$" test.cnf  &amp;gt;/dev/null&lt;BR /&gt;     then&lt;BR /&gt;       echo "entry1 : ${entry1} entry2: ${entry2} var:${var} "&lt;BR /&gt;     fi&lt;BR /&gt;  else&lt;BR /&gt;     echo "entry1 : ${entry1} entry2: ${entry2}"&lt;BR /&gt;   fi&lt;BR /&gt;  fi&lt;BR /&gt;fi&lt;BR /&gt;&lt;BR /&gt;# begin&lt;BR /&gt;&lt;BR /&gt;regards&lt;/WHITESPACE&gt;&lt;/WHITESPACE&gt;&lt;/BLANK&gt;</description>
      <pubDate>Fri, 01 Oct 2010 09:53:18 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/parse-a-file-with-expressions-grep/m-p/5257439#M659099</guid>
      <dc:creator>Billa-User</dc:creator>
      <dc:date>2010-10-01T09:53:18Z</dc:date>
    </item>
    <item>
      <title>Re: parse a file with expressions (grep)</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/parse-a-file-with-expressions-grep/m-p/5257440#M659100</link>
      <description>Hi&lt;BR /&gt;&lt;BR /&gt;may be you could use awk. Pass the 3 variables to the awk script. Check $1 and $2 vs entry1 and entry2. if you have a 3rd field (check NF for nb field in current record), the decide to print the relevant result.&lt;BR /&gt;&lt;BR /&gt;awk -v en1=$entry1 -v en2=$entry2 -v var=$var&lt;BR /&gt;'{if($1==en1) { if($2==en2) &lt;BR /&gt;   { ...&lt;BR /&gt;    }&lt;BR /&gt;' test.cnf&lt;BR /&gt;&lt;BR /&gt;Regards&lt;BR /&gt;Jean-Luc</description>
      <pubDate>Fri, 01 Oct 2010 10:32:31 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/parse-a-file-with-expressions-grep/m-p/5257440#M659100</guid>
      <dc:creator>Jean-Luc Oudart</dc:creator>
      <dc:date>2010-10-01T10:32:31Z</dc:date>
    </item>
    <item>
      <title>Re: parse a file with expressions (grep)</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/parse-a-file-with-expressions-grep/m-p/5257441#M659101</link>
      <description>I would like perl or awk for this also, as one program activation can do it all versus the convuleted nesting.&lt;BR /&gt;&lt;BR /&gt;As you indeed looking for 3 specific words with option whitespace?&lt;BR /&gt;&lt;BR /&gt;If you need further help, then you may want to reply with a TEXT file attachment showing sample input lines which should, or should not match.&lt;BR /&gt;&lt;BR /&gt;Speaking of which, it is not immediately clear to me if/how you want to deal with multiple matching or partially matching lines.&lt;BR /&gt;&lt;BR /&gt;Using awk you can test for the presence of 'var' using NF = 3 or NF &amp;gt; 2&lt;BR /&gt;&lt;BR /&gt;Anyway... It looks like the 'whitespace' requirement simple was not carried out completely.&lt;BR /&gt;&lt;BR /&gt;Specifically,  the second and third grep read: grep "^${entry1}...&lt;BR /&gt;Should that not be: grep "^[ \t]*${entry1}&lt;BR /&gt;&lt;BR /&gt;And on the 3rd grep it reads: ${entry2}${var}&lt;BR /&gt;So those two words should be adjacent without whitespace?&lt;BR /&gt;&lt;BR /&gt;hth,&lt;BR /&gt;Hein&lt;BR /&gt;</description>
      <pubDate>Fri, 01 Oct 2010 11:45:52 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/parse-a-file-with-expressions-grep/m-p/5257441#M659101</guid>
      <dc:creator>Hein van den Heuvel</dc:creator>
      <dc:date>2010-10-01T11:45:52Z</dc:date>
    </item>
    <item>
      <title>Re: parse a file with expressions (grep)</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/parse-a-file-with-expressions-grep/m-p/5257442#M659102</link>
      <description>why not&lt;BR /&gt;&lt;BR /&gt;grep -v "$entry1 $entry2 "&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Fri, 01 Oct 2010 11:57:45 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/parse-a-file-with-expressions-grep/m-p/5257442#M659102</guid>
      <dc:creator>Laurent Menase</dc:creator>
      <dc:date>2010-10-01T11:57:45Z</dc:date>
    </item>
    <item>
      <title>Re: parse a file with expressions (grep)</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/parse-a-file-with-expressions-grep/m-p/5257443#M659103</link>
      <description>Instead of "grep foo file &amp;gt; /dev/null" you can simply this as:&lt;BR /&gt;grep -q foo file&lt;BR /&gt;&lt;BR /&gt;&amp;gt;but should not find: entry1   entry2 var&lt;BR /&gt;&lt;BR /&gt;Are you going to check for an empty string for $var?&lt;BR /&gt;&lt;BR /&gt;Do you have an example of your script, your datafile and your script parms?&lt;BR /&gt;&lt;BR /&gt;&amp;gt;[ \t]&lt;BR /&gt;&lt;BR /&gt;This escape "\t" doesn't work for grep.</description>
      <pubDate>Sat, 02 Oct 2010 05:15:53 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/parse-a-file-with-expressions-grep/m-p/5257443#M659103</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2010-10-02T05:15:53Z</dc:date>
    </item>
    <item>
      <title>Re: parse a file with expressions (grep)</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/parse-a-file-with-expressions-grep/m-p/5257444#M659104</link>
      <description>parameters for testing:&lt;BR /&gt;&lt;BR /&gt;./test.sh entry1 entry2&lt;BR /&gt;./test.sh entry1 entry2 var&lt;BR /&gt;&lt;BR /&gt;the test script should parse file "test.cnf" (attachment)&lt;BR /&gt;field separator &lt;BLANK&gt; or &lt;WHITESPACE&gt;.&lt;BR /&gt;&lt;BR /&gt;regards&lt;/WHITESPACE&gt;&lt;/BLANK&gt;</description>
      <pubDate>Mon, 04 Oct 2010 05:30:41 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/parse-a-file-with-expressions-grep/m-p/5257444#M659104</guid>
      <dc:creator>Billa-User</dc:creator>
      <dc:date>2010-10-04T05:30:41Z</dc:date>
    </item>
    <item>
      <title>Re: parse a file with expressions (grep)</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/parse-a-file-with-expressions-grep/m-p/5257445#M659105</link>
      <description>test script:&lt;BR /&gt;&lt;BR /&gt;test.sh&lt;BR /&gt;</description>
      <pubDate>Mon, 04 Oct 2010 05:31:26 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/parse-a-file-with-expressions-grep/m-p/5257445#M659105</guid>
      <dc:creator>Billa-User</dc:creator>
      <dc:date>2010-10-04T05:31:26Z</dc:date>
    </item>
    <item>
      <title>Re: parse a file with expressions (grep)</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/parse-a-file-with-expressions-grep/m-p/5257446#M659106</link>
      <description>&lt;!--!*#--&gt;hello,&lt;BR /&gt;&lt;BR /&gt;i tested following "awk" and it matches the exact entries (field separator &lt;BLANK&gt; or &lt;WHITESPACE&gt;), is it a good solution ?&lt;BR /&gt;&lt;BR /&gt;awk -v entry1="${entry1}" -v entry2="${entry2}" -v var="${var}" 'BEGIN { FS = "[ \t]*|[ \t]+" } &lt;BR /&gt;       $1 ~ /^'entry1'$/ &amp;amp;&amp;amp; $2 ~ /^'entry2'$/ &amp;amp;&amp;amp; $3 ~ /^'var'$/ { print "FOUND" }' test.cnf&lt;BR /&gt;&lt;BR /&gt;if [ `awk -v entry1="${entry1}" -v entry2="${entry2}" -v var="${var}" 'BEGIN { FS = "[ \t]*|[ \t]+" } &lt;BR /&gt;       $1 ~ /^'entry1'$/ &amp;amp;&amp;amp; $2 ~ /^'entry2'$/ &amp;amp;&amp;amp; $3 ~ /^'var'$/ { print "FOUND" }' test.cnf` = "FOUND" ]&lt;BR /&gt;then&lt;BR /&gt;  echo "awk: FOUND"&lt;BR /&gt;fi &lt;BR /&gt;&lt;BR /&gt;also a test with "grep" :&lt;BR /&gt;OLDIFS=$IFS&lt;BR /&gt;IFS="[ \t]*|[ \t]+"&lt;BR /&gt;grep "^${entry1} ${entry2} ${var}$" test.cnf&lt;BR /&gt;&lt;BR /&gt;IFS=$OLDIFS&lt;BR /&gt;&lt;/WHITESPACE&gt;&lt;/BLANK&gt;</description>
      <pubDate>Mon, 04 Oct 2010 10:50:09 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/parse-a-file-with-expressions-grep/m-p/5257446#M659106</guid>
      <dc:creator>Billa-User</dc:creator>
      <dc:date>2010-10-04T10:50:09Z</dc:date>
    </item>
    <item>
      <title>Re: parse a file with expressions (grep)</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/parse-a-file-with-expressions-grep/m-p/5257447#M659107</link>
      <description>&lt;!--!*#--&gt;Hi:&lt;BR /&gt;&lt;BR /&gt;&amp;gt; i tested following "awk" and it matches the exact entries (field separator &lt;BLANK&gt; or &lt;WHITESPACE&gt;), is it a good solution ?&lt;BR /&gt;&lt;BR /&gt;OK, but for the 'grep' code, you haven't paid attention to what Dennis said about the use of '\t' for a TAB character: HP's 'grep' doesn't recognize it and you are being fooled into thinking it does when you use &lt;BR /&gt;&lt;BR /&gt;# grep "^[ \t]*"&lt;BR /&gt;&lt;BR /&gt;Consider that this matches:&lt;BR /&gt;&lt;BR /&gt;# echo "aaa"|grep "^[\t ]*"&lt;BR /&gt;aaa&lt;BR /&gt;&lt;BR /&gt;You can match because the asterisk ("*") matches ZERO or more characters.  You have none in the example above, and that *meets* the criteria.&lt;BR /&gt;&lt;BR /&gt;Further, the '\t' isn't understood by 'grep' in HP-UX.  If it was, this would work:&lt;BR /&gt;&lt;BR /&gt;# echo "\t"|grep "[\t]"&lt;BR /&gt;&lt;BR /&gt;...and it does *not*.  You could use a literally composed TAB (which the Forums formatting will obliterate unless you copy-and-paste this:&lt;BR /&gt;&lt;BR /&gt;# echo "\t"|grep "[    ]"&lt;BR /&gt;&lt;BR /&gt;AWK *does* understand the '\t' notation, however.&lt;BR /&gt;&lt;BR /&gt;If you use 'grep -E' to invoke the extended regular expression engine, you can use '+' to signify ONE or more instances of the preceding character.&lt;BR /&gt;&lt;BR /&gt;AWK supports extended regular expresssions, so this can be used there, too.&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...&lt;BR /&gt;&lt;BR /&gt;&lt;/WHITESPACE&gt;&lt;/BLANK&gt;</description>
      <pubDate>Mon, 04 Oct 2010 11:27:22 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/parse-a-file-with-expressions-grep/m-p/5257447#M659107</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2010-10-04T11:27:22Z</dc:date>
    </item>
    <item>
      <title>Re: parse a file with expressions (grep)</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/parse-a-file-with-expressions-grep/m-p/5257448#M659108</link>
      <description>&amp;gt;I tested following "awk" and it matches the exact entries (field separator &lt;BLANK&gt; or &lt;WHITESPACE&gt;), is it a good solution?&lt;BR /&gt;&lt;BR /&gt;Since this is the default, you don't want to set FS.&lt;BR /&gt;And if you are going to use awk, you shouldn't have to invoke it more than once.&lt;BR /&gt;&lt;BR /&gt;&amp;gt;also a test with grep:&lt;BR /&gt;&amp;gt;IFS="[ \t]*|[ \t]+"&lt;BR /&gt;&amp;gt;grep "^${entry1} ${entry2} ${var}$" test.cnf&lt;BR /&gt;&lt;BR /&gt;grep doesn't look at IFS, only the shell and you don't have the proper format for IFS since it normally has: space, tab, and newline&lt;/WHITESPACE&gt;&lt;/BLANK&gt;</description>
      <pubDate>Mon, 04 Oct 2010 11:53:35 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/parse-a-file-with-expressions-grep/m-p/5257448#M659108</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2010-10-04T11:53:35Z</dc:date>
    </item>
    <item>
      <title>Re: parse a file with expressions (grep)</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/parse-a-file-with-expressions-grep/m-p/5257449#M659109</link>
      <description>&amp;gt;awk -v entry1="${entry1}" -v entry2="${entry2}" -v var="${var}" 'BEGIN { FS = "[ \t]*|[ \t]+" }&lt;BR /&gt;$1 ~ /^'entry1'$/ &amp;amp;&amp;amp; $2 ~ /^'entry2'$/ &amp;amp;&amp;amp; $3 ~ /^'var'$/ { print "FOUND" }' test.cnf&lt;BR /&gt;&lt;BR /&gt;There is no need for your single quotes around entry1, etc.  They aren't doing what you think.&lt;BR /&gt;Also, there may be no need to do pattern matching, you could do exact match:&lt;BR /&gt;awk -v entry1="${entry1}" -v entry2="${entry2}" -v var="${var}" '&lt;BR /&gt;$1 == entry1 &amp;amp;&amp;amp; $2 == entry2 &amp;amp;&amp;amp; $3 == var { print "FOUND" }' test.cnf&lt;BR /&gt;&lt;BR /&gt;And if you really wanted to do pattern matching you would need to use something like:&lt;BR /&gt;$1 ~ /^'$entry1'$/&lt;BR /&gt;(And forget about using awk -v.)&lt;BR /&gt;&lt;BR /&gt;Or do:&lt;BR /&gt;$1 ~ "^" entry1 "$"</description>
      <pubDate>Tue, 05 Oct 2010 02:19:37 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/parse-a-file-with-expressions-grep/m-p/5257449#M659109</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2010-10-05T02:19:37Z</dc:date>
    </item>
    <item>
      <title>Re: parse a file with expressions (grep)</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/parse-a-file-with-expressions-grep/m-p/5257450#M659110</link>
      <description>hello,&lt;BR /&gt;&lt;BR /&gt;thx to all for your input, last i have a special question, i add to "test.cnf" following entry:&lt;BR /&gt;&lt;BR /&gt;* * var&lt;BR /&gt;&lt;BR /&gt;and start test.sh (in attachment)&lt;BR /&gt;&lt;BR /&gt;./test.sh entry1 entry2 var&lt;BR /&gt;&lt;BR /&gt;this should find:&lt;BR /&gt;entry1 entry2 var&lt;BR /&gt;* * var&lt;BR /&gt;&lt;BR /&gt;how can i use "*" in awk ?&lt;BR /&gt;&lt;BR /&gt;regards,</description>
      <pubDate>Tue, 05 Oct 2010 13:20:12 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/parse-a-file-with-expressions-grep/m-p/5257450#M659110</guid>
      <dc:creator>Billa-User</dc:creator>
      <dc:date>2010-10-05T13:20:12Z</dc:date>
    </item>
    <item>
      <title>Re: parse a file with expressions (grep)</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/parse-a-file-with-expressions-grep/m-p/5257451#M659111</link>
      <description>&amp;gt;this should find: * * var&lt;BR /&gt;&amp;gt;how can I use "*" in awk?&lt;BR /&gt;&lt;BR /&gt;Where are your patterns?  On the command line or in your test.cnf?&lt;BR /&gt;&lt;BR /&gt;Do you want to have the command line or test.cnf have EREs?  Or do you want an exact match with a special case of "*" in test.cnf?&lt;BR /&gt;&lt;BR /&gt;&amp;gt;if ($1 == /^\*/ &amp;amp;&amp;amp; entry2 == /^\*/) {&lt;BR /&gt;&lt;BR /&gt;I have no idea what this will do.  == should take either a literal string, number or variable.  I guess "/^\*/" is just an expression and it seems to have the value 0 if it doesn't match $0.</description>
      <pubDate>Wed, 06 Oct 2010 10:19:42 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/parse-a-file-with-expressions-grep/m-p/5257451#M659111</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2010-10-06T10:19:42Z</dc:date>
    </item>
    <item>
      <title>Re: parse a file with expressions (grep)</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/parse-a-file-with-expressions-grep/m-p/5257452#M659112</link>
      <description>&lt;!--!*#--&gt;&lt;BR /&gt;@ Where are your patterns? On the command line or in your test.cnf?&lt;BR /&gt;in the attachment script (test.sh)&lt;BR /&gt;&lt;BR /&gt;@ Do you want to have the command line or test.cnf have EREs? Or do you want an exact match with a special case of "*" in test.cnf?&lt;BR /&gt;i want it , if it easy to handle in test.cnf.&lt;BR /&gt;&lt;BR /&gt;sorry, it explained it very bad .&lt;BR /&gt;&lt;BR /&gt;what i mean :&lt;BR /&gt;&lt;BR /&gt;i want to make an entry in config-file with wildcard's? like :&lt;BR /&gt;&lt;BR /&gt;* * var&lt;BR /&gt;&lt;BR /&gt;and then i want to search with a statement all entry's field 1 and 2 and with exact value in field 3 (example : var)&lt;BR /&gt;&lt;BR /&gt;also i think it complicated to search entries with example&lt;BR /&gt;entry* entry* var &lt;BR /&gt;&lt;BR /&gt;but this i don't need for my case.&lt;BR /&gt;&lt;BR /&gt;in the meantime in think about following,&lt;BR /&gt;i create a placeholder or wildcard for "*" like "allmatches" and it is&lt;BR /&gt;easier to handle in statement's . example:&lt;BR /&gt;&lt;BR /&gt;allmatches allmatches var</description>
      <pubDate>Thu, 07 Oct 2010 10:19:55 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/parse-a-file-with-expressions-grep/m-p/5257452#M659112</guid>
      <dc:creator>Billa-User</dc:creator>
      <dc:date>2010-10-07T10:19:55Z</dc:date>
    </item>
    <item>
      <title>Re: parse a file with expressions (grep)</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/parse-a-file-with-expressions-grep/m-p/5257453#M659113</link>
      <description>&amp;gt;I want to make an entry in config-file with wildcards? like: * * var&lt;BR /&gt;&amp;gt;I want to search with a statement all entries field 1 and 2 and with exact value in field 3 (example: var)&lt;BR /&gt;&lt;BR /&gt;&amp;gt;I think it complicated to search entries with example: entry* entry* var&lt;BR /&gt;&amp;gt;but this I don't need for my case.&lt;BR /&gt;&lt;BR /&gt;Right, this is harder but if you use EREs, you can do that in awk.&lt;BR /&gt;&lt;BR /&gt;&amp;gt;I create a placeholder or wildcard for "*" like "allmatches" and it is easier to handle in statements&lt;BR /&gt;&lt;BR /&gt;No, "*" is easier:&lt;BR /&gt;# Pattern in test.cnf&lt;BR /&gt;# Use == for match&lt;BR /&gt;awk -v entry1="${entry1}" -v entry2="${entry2}" -v var="${var}" '&lt;BR /&gt;($1 == "*" || $1 == entry1) &amp;amp;&amp;amp;&lt;BR /&gt;($2 == "*" || $2 == entry2) &amp;amp;&amp;amp;&lt;BR /&gt;$3 == var { print "FOUND5:", $0 }' test.cnf</description>
      <pubDate>Sat, 09 Oct 2010 01:45:13 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/parse-a-file-with-expressions-grep/m-p/5257453#M659113</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2010-10-09T01:45:13Z</dc:date>
    </item>
    <item>
      <title>Re: parse a file with expressions (grep)</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/parse-a-file-with-expressions-grep/m-p/5257454#M659114</link>
      <description>perfect,thank you very,very much!!</description>
      <pubDate>Mon, 11 Oct 2010 06:21:32 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/parse-a-file-with-expressions-grep/m-p/5257454#M659114</guid>
      <dc:creator>Billa-User</dc:creator>
      <dc:date>2010-10-11T06:21:32Z</dc:date>
    </item>
  </channel>
</rss>

