<?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 regular expression in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/regular-expression/m-p/2714317#M947136</link>
    <description>Hello,&lt;BR /&gt;&lt;BR /&gt;My expression can two forms:&lt;BR /&gt;vgcreate -p yara -e yara &lt;BR /&gt;&lt;BR /&gt;or&lt;BR /&gt;&lt;BR /&gt;vgcreate -g yara -p yara -e yara&lt;BR /&gt;&lt;BR /&gt;What kind of regular expression I can use to identify that -g option was used?&lt;BR /&gt;&lt;BR /&gt;I tried "grep vgcreate*.*-g*.*" didn't work!&lt;BR /&gt;&lt;BR /&gt;Thanks a lot!&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
    <pubDate>Tue, 30 Apr 2002 15:50:40 GMT</pubDate>
    <dc:creator>andi_1</dc:creator>
    <dc:date>2002-04-30T15:50:40Z</dc:date>
    <item>
      <title>regular expression</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/regular-expression/m-p/2714317#M947136</link>
      <description>Hello,&lt;BR /&gt;&lt;BR /&gt;My expression can two forms:&lt;BR /&gt;vgcreate -p yara -e yara &lt;BR /&gt;&lt;BR /&gt;or&lt;BR /&gt;&lt;BR /&gt;vgcreate -g yara -p yara -e yara&lt;BR /&gt;&lt;BR /&gt;What kind of regular expression I can use to identify that -g option was used?&lt;BR /&gt;&lt;BR /&gt;I tried "grep vgcreate*.*-g*.*" didn't work!&lt;BR /&gt;&lt;BR /&gt;Thanks a lot!&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 30 Apr 2002 15:50:40 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/regular-expression/m-p/2714317#M947136</guid>
      <dc:creator>andi_1</dc:creator>
      <dc:date>2002-04-30T15:50:40Z</dc:date>
    </item>
    <item>
      <title>Re: regular expression</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/regular-expression/m-p/2714318#M947137</link>
      <description>Be sure quotes are around the expression-&lt;BR /&gt;&lt;BR /&gt;vgcreate -g yara -p yara -e yara &lt;BR /&gt;&lt;BR /&gt;grep -- "-g " file&lt;BR /&gt;&lt;BR /&gt;The two -- are so grep knows that -g is not on option for it to use.&lt;BR /&gt;&lt;BR /&gt;In your sample you didn't have double quotes around the expression and the shell will attempt to expand them to filenames.&lt;BR /&gt;&lt;BR /&gt;-- Rod Hills</description>
      <pubDate>Tue, 30 Apr 2002 16:04:08 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/regular-expression/m-p/2714318#M947137</guid>
      <dc:creator>Rodney Hills</dc:creator>
      <dc:date>2002-04-30T16:04:08Z</dc:date>
    </item>
    <item>
      <title>Re: regular expression</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/regular-expression/m-p/2714319#M947138</link>
      <description>Hi Rodney,&lt;BR /&gt;&lt;BR /&gt;I tried you way, didn't work.&lt;BR /&gt;&lt;BR /&gt;grep -- vgcreate*.*"-g"*.* filename&lt;BR /&gt;&lt;BR /&gt;Thanks!</description>
      <pubDate>Tue, 30 Apr 2002 16:06:43 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/regular-expression/m-p/2714319#M947138</guid>
      <dc:creator>andi_1</dc:creator>
      <dc:date>2002-04-30T16:06:43Z</dc:date>
    </item>
    <item>
      <title>Re: regular expression</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/regular-expression/m-p/2714320#M947139</link>
      <description>Hi Andi&lt;BR /&gt;&lt;BR /&gt;You are right it take "-g" as an option for grep .&lt;BR /&gt;&lt;BR /&gt;Try this&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;grep "\-g"&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;this should be good to go.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Manoj Srivastava</description>
      <pubDate>Tue, 30 Apr 2002 16:17:27 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/regular-expression/m-p/2714320#M947139</guid>
      <dc:creator>MANOJ SRIVASTAVA</dc:creator>
      <dc:date>2002-04-30T16:17:27Z</dc:date>
    </item>
    <item>
      <title>Re: regular expression</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/regular-expression/m-p/2714321#M947140</link>
      <description>Hi Andi&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;ie again &lt;BR /&gt;&lt;BR /&gt;grep "\-g" file&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Manoj Srivastava</description>
      <pubDate>Tue, 30 Apr 2002 16:21:10 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/regular-expression/m-p/2714321#M947140</guid>
      <dc:creator>MANOJ SRIVASTAVA</dc:creator>
      <dc:date>2002-04-30T16:21:10Z</dc:date>
    </item>
    <item>
      <title>Re: regular expression</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/regular-expression/m-p/2714322#M947141</link>
      <description>This should work for you ..&lt;BR /&gt;&lt;BR /&gt;# grep -e 'vgcreate* '\-g' *' filename</description>
      <pubDate>Tue, 30 Apr 2002 16:21:29 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/regular-expression/m-p/2714322#M947141</guid>
      <dc:creator>S.K. Chan</dc:creator>
      <dc:date>2002-04-30T16:21:29Z</dc:date>
    </item>
    <item>
      <title>Re: regular expression</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/regular-expression/m-p/2714323#M947142</link>
      <description>If it is at same position everytime then you can use cut&lt;BR /&gt;&lt;BR /&gt;#t=1234567890&lt;BR /&gt;#echo $t |cut -c 6 will return 6.&lt;BR /&gt;&lt;BR /&gt;In your case it is 11&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Sachin</description>
      <pubDate>Tue, 30 Apr 2002 16:22:49 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/regular-expression/m-p/2714323#M947142</guid>
      <dc:creator>Sachin Patel</dc:creator>
      <dc:date>2002-04-30T16:22:49Z</dc:date>
    </item>
    <item>
      <title>Re: regular expression</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/regular-expression/m-p/2714324#M947143</link>
      <description>&amp;gt; My expression can two forms: &lt;BR /&gt;&amp;gt; vgcreate -p yara -e yara &lt;BR /&gt;&lt;BR /&gt;&amp;gt; or &lt;BR /&gt;&lt;BR /&gt;&amp;gt; vgcreate -g yara -p yara -e yara &lt;BR /&gt;&lt;BR /&gt;&amp;gt; What kind of regular expression I can use to &amp;gt; identify that -g option was used? &lt;BR /&gt;&lt;BR /&gt;&amp;gt; I tried "grep vgcreate*.*-g*.*" didn't work! &lt;BR /&gt;&lt;BR /&gt;&amp;gt; Thanks a lot! &lt;BR /&gt;&lt;BR /&gt;grep 'vgcreate.*-g'&lt;BR /&gt;&lt;BR /&gt;The '*' after the 'e' in vgcreate is a common&lt;BR /&gt;confusion between regular expressions and glob&lt;BR /&gt;patterns (such as what the shell uses to match&lt;BR /&gt;files). Those quotes are single quotes, not backticks; that is IMPORTANT. Double quotes would also work here. The '*' after the 'g'&lt;BR /&gt;actually BREAKS the search, since it indicates&lt;BR /&gt;that the 0 or more more 'g's can match. It is not necessary to match the entire line to get&lt;BR /&gt;grep to match, so the attempt to match&lt;BR /&gt;"everything else" after the '-g' is unnecessary.&lt;BR /&gt;</description>
      <pubDate>Tue, 30 Apr 2002 17:27:44 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/regular-expression/m-p/2714324#M947143</guid>
      <dc:creator>Charles Stepp</dc:creator>
      <dc:date>2002-04-30T17:27:44Z</dc:date>
    </item>
  </channel>
</rss>

