<?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 Using regular expressions with sed in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/using-regular-expressions-with-sed/m-p/5130088#M674872</link>
    <description>Hello all,&lt;BR /&gt;&lt;BR /&gt;I'm trying to write a script that will remove a directory from the PATH environment variable.&lt;BR /&gt;I know the directory (MF_SE) but not which tree it's in (ie it could be under a users /home or in /usr/local or elsewhere.&lt;BR /&gt;So I'm trying to replace ":[a-z/]MF_SE[a-z/]:" by ":"&lt;BR /&gt;&lt;BR /&gt;I tried the following without results:&lt;BR /&gt;sed -e 's|:\[a-z/\]MF_SE\[a-z/\]:|:|' path&lt;BR /&gt;...:/usr/lib/nis:/opt/sec_mgmt/spc/bin:/opt/ssh/bin:/opt/oracle/product/10g/bin:/home/boucherr/MF_SE_41/history/bin:.:/home/boucherr/bin:.&lt;BR /&gt;&lt;BR /&gt;As you see, no warnings or errors but no change performed.&lt;BR /&gt;&lt;BR /&gt;Can anyone shed light?&lt;BR /&gt;Thanks</description>
    <pubDate>Tue, 16 Sep 2008 17:51:31 GMT</pubDate>
    <dc:creator>Raynald Boucher</dc:creator>
    <dc:date>2008-09-16T17:51:31Z</dc:date>
    <item>
      <title>Using regular expressions with sed</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/using-regular-expressions-with-sed/m-p/5130088#M674872</link>
      <description>Hello all,&lt;BR /&gt;&lt;BR /&gt;I'm trying to write a script that will remove a directory from the PATH environment variable.&lt;BR /&gt;I know the directory (MF_SE) but not which tree it's in (ie it could be under a users /home or in /usr/local or elsewhere.&lt;BR /&gt;So I'm trying to replace ":[a-z/]MF_SE[a-z/]:" by ":"&lt;BR /&gt;&lt;BR /&gt;I tried the following without results:&lt;BR /&gt;sed -e 's|:\[a-z/\]MF_SE\[a-z/\]:|:|' path&lt;BR /&gt;...:/usr/lib/nis:/opt/sec_mgmt/spc/bin:/opt/ssh/bin:/opt/oracle/product/10g/bin:/home/boucherr/MF_SE_41/history/bin:.:/home/boucherr/bin:.&lt;BR /&gt;&lt;BR /&gt;As you see, no warnings or errors but no change performed.&lt;BR /&gt;&lt;BR /&gt;Can anyone shed light?&lt;BR /&gt;Thanks</description>
      <pubDate>Tue, 16 Sep 2008 17:51:31 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/using-regular-expressions-with-sed/m-p/5130088#M674872</guid>
      <dc:creator>Raynald Boucher</dc:creator>
      <dc:date>2008-09-16T17:51:31Z</dc:date>
    </item>
    <item>
      <title>Re: Using regular expressions with sed</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/using-regular-expressions-with-sed/m-p/5130089#M674873</link>
      <description>What if there are uppercase characters or numerics in the path?&lt;BR /&gt;&lt;BR /&gt;Me thinks you want to find a ':', any number of not-':', a slash, the directory name, any number of not-':, and a ':'.&lt;BR /&gt;&lt;BR /&gt;As in:&lt;BR /&gt;&lt;BR /&gt;PATH=$( echo $PATH | sed -e 's|:[^:]*/MF_SE[^:]*:|:|' )&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;hth,&lt;BR /&gt;Hein.&lt;BR /&gt;</description>
      <pubDate>Tue, 16 Sep 2008 18:22:55 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/using-regular-expressions-with-sed/m-p/5130089#M674873</guid>
      <dc:creator>Hein van den Heuvel</dc:creator>
      <dc:date>2008-09-16T18:22:55Z</dc:date>
    </item>
    <item>
      <title>Re: Using regular expressions with sed</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/using-regular-expressions-with-sed/m-p/5130090#M674874</link>
      <description>Way to go!&lt;BR /&gt;&lt;BR /&gt;I had made some corrections to mt original attempt and got it working with an uppercase identification string but could not get results with a lowercase string.&lt;BR /&gt;&lt;BR /&gt;I didn't know about the "not" character.&lt;BR /&gt;Where is this documented?&lt;BR /&gt;I checked the man pages for sed, vi, regexp and I didn't spot it.&lt;BR /&gt;&lt;BR /&gt;Many thanks&lt;BR /&gt;&lt;BR /&gt;RayB</description>
      <pubDate>Wed, 17 Sep 2008 12:25:24 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/using-regular-expressions-with-sed/m-p/5130090#M674874</guid>
      <dc:creator>Raynald Boucher</dc:creator>
      <dc:date>2008-09-17T12:25:24Z</dc:date>
    </item>
    <item>
      <title>Re: Using regular expressions with sed</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/using-regular-expressions-with-sed/m-p/5130091#M674875</link>
      <description>Hi Raynald:&lt;BR /&gt;&lt;BR /&gt;&amp;gt; I didn't know about the "not" character. &lt;BR /&gt;Where is this documented? &lt;BR /&gt;&lt;BR /&gt;See 'man 5 regexp' in the discussion of "non-matching list".&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Wed, 17 Sep 2008 12:43:43 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/using-regular-expressions-with-sed/m-p/5130091#M674875</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2008-09-17T12:43:43Z</dc:date>
    </item>
    <item>
      <title>Re: Using regular expressions with sed</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/using-regular-expressions-with-sed/m-p/5130092#M674876</link>
      <description>I know it from the perl man pages, but I just looked it up.&lt;BR /&gt;man sed --&amp;gt; man regexp&lt;BR /&gt;man 5 regexp ---&amp;gt;&lt;BR /&gt;&lt;BR /&gt;" ^              The circumflex is special when used as the first character of an entire RE (see Expression Anchoring) or as the first character of a bracket expression."&lt;BR /&gt;&lt;BR /&gt;"           non-matching list&lt;BR /&gt;                          A non-matching list expression begins with a circumflex (^), and specifies a list that matches any character or collating element except newline and the characters represented in the list."&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;hth,&lt;BR /&gt;Hein.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 17 Sep 2008 12:48:03 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/using-regular-expressions-with-sed/m-p/5130092#M674876</guid>
      <dc:creator>Hein van den Heuvel</dc:creator>
      <dc:date>2008-09-17T12:48:03Z</dc:date>
    </item>
    <item>
      <title>Re: Using regular expressions with sed</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/using-regular-expressions-with-sed/m-p/5130093#M674877</link>
      <description>Good, I'll look it up more attentively.&lt;BR /&gt;I had used "man regexp".&lt;BR /&gt;&lt;BR /&gt;Thanks again&lt;BR /&gt;&lt;BR /&gt;RayB</description>
      <pubDate>Wed, 17 Sep 2008 13:07:08 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/using-regular-expressions-with-sed/m-p/5130093#M674877</guid>
      <dc:creator>Raynald Boucher</dc:creator>
      <dc:date>2008-09-17T13:07:08Z</dc:date>
    </item>
  </channel>
</rss>

