<?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 replacing text - perl, awk.... in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/replacing-text-perl-awk/m-p/3336915#M190004</link>
    <description>Hi,&lt;BR /&gt;I have many entries like below in a file&lt;BR /&gt;/disk1/oracle/HP/hp01.dbf&lt;BR /&gt;to&lt;BR /&gt;/disk1/oracle/HP/hp01.dbf&lt;BR /&gt;&lt;BR /&gt;/disk2/oracle/HP/hp02.dbf&lt;BR /&gt;to&lt;BR /&gt;/disk2/oracle/HP/hp02.dbf&lt;BR /&gt;&lt;BR /&gt;I would like to change them as follows&lt;BR /&gt;&lt;BR /&gt;/disk1/oracle/HP/hp01.dbf&lt;BR /&gt;to&lt;BR /&gt;/disk1_dev/oracle_dev/hp01.dbf&lt;BR /&gt;&lt;BR /&gt;/disk2/oracle/HP/hp02.dbf&lt;BR /&gt;to&lt;BR /&gt;/disk2_dev/oracle_dev/HP/hp02.dbf&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;Steven&lt;BR /&gt;</description>
    <pubDate>Wed, 21 Jul 2004 01:09:21 GMT</pubDate>
    <dc:creator>hpuxsa</dc:creator>
    <dc:date>2004-07-21T01:09:21Z</dc:date>
    <item>
      <title>replacing text - perl, awk....</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/replacing-text-perl-awk/m-p/3336915#M190004</link>
      <description>Hi,&lt;BR /&gt;I have many entries like below in a file&lt;BR /&gt;/disk1/oracle/HP/hp01.dbf&lt;BR /&gt;to&lt;BR /&gt;/disk1/oracle/HP/hp01.dbf&lt;BR /&gt;&lt;BR /&gt;/disk2/oracle/HP/hp02.dbf&lt;BR /&gt;to&lt;BR /&gt;/disk2/oracle/HP/hp02.dbf&lt;BR /&gt;&lt;BR /&gt;I would like to change them as follows&lt;BR /&gt;&lt;BR /&gt;/disk1/oracle/HP/hp01.dbf&lt;BR /&gt;to&lt;BR /&gt;/disk1_dev/oracle_dev/hp01.dbf&lt;BR /&gt;&lt;BR /&gt;/disk2/oracle/HP/hp02.dbf&lt;BR /&gt;to&lt;BR /&gt;/disk2_dev/oracle_dev/HP/hp02.dbf&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;Steven&lt;BR /&gt;</description>
      <pubDate>Wed, 21 Jul 2004 01:09:21 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/replacing-text-perl-awk/m-p/3336915#M190004</guid>
      <dc:creator>hpuxsa</dc:creator>
      <dc:date>2004-07-21T01:09:21Z</dc:date>
    </item>
    <item>
      <title>Re: replacing text - perl, awk....</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/replacing-text-perl-awk/m-p/3336916#M190005</link>
      <description>Hi Steven,&lt;BR /&gt;&lt;BR /&gt;my solution,&lt;BR /&gt;&lt;BR /&gt;Create a script in awk like this:&lt;BR /&gt;&lt;BR /&gt;----- s.awk -------------------&lt;BR /&gt;BEGIN {&lt;BR /&gt;  flag_to=0&lt;BR /&gt;  FS="/"&lt;BR /&gt;  OFS="/"&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;/to/ { flag_to=1 }&lt;BR /&gt;/disk1/ { if (flag_to==1) $2="disk1_dev" ; flag_to=0}&lt;BR /&gt;/disk2/ { if (flag_to==1) $2="disk1_dev" ; flag_to=0}&lt;BR /&gt;{ print }&lt;BR /&gt;--------------------------------&lt;BR /&gt;&lt;BR /&gt;Then run it:&lt;BR /&gt;&lt;BR /&gt;awk -f s.awk filein &amp;gt; fileout&lt;BR /&gt;&lt;BR /&gt;Hope this helps.&lt;BR /&gt;&lt;BR /&gt;Frank.&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 21 Jul 2004 01:46:31 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/replacing-text-perl-awk/m-p/3336916#M190005</guid>
      <dc:creator>Francisco J. Soler</dc:creator>
      <dc:date>2004-07-21T01:46:31Z</dc:date>
    </item>
    <item>
      <title>Re: replacing text - perl, awk....</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/replacing-text-perl-awk/m-p/3336917#M190006</link>
      <description># perl -pi -e's{\b(disk\d|oracle)/}{$1_dev/};s{/HP/}{/}' your_file&lt;BR /&gt;&lt;BR /&gt;Enjoy, Have FUN! H.Merijn</description>
      <pubDate>Wed, 21 Jul 2004 02:00:36 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/replacing-text-perl-awk/m-p/3336917#M190006</guid>
      <dc:creator>H.Merijn Brand (procura</dc:creator>
      <dc:date>2004-07-21T02:00:36Z</dc:date>
    </item>
    <item>
      <title>Re: replacing text - perl, awk....</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/replacing-text-perl-awk/m-p/3336918#M190007</link>
      <description>hi, &lt;BR /&gt; &lt;BR /&gt;these are the datafiles of an Oracle DB.  You probably got this list with an SQL statement.  How about modifying this SQL statement and "replacing" the second part.&lt;BR /&gt; &lt;BR /&gt;regards,&lt;BR /&gt;Thierry.</description>
      <pubDate>Wed, 21 Jul 2004 02:01:19 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/replacing-text-perl-awk/m-p/3336918#M190007</guid>
      <dc:creator>Thierry Poels_1</dc:creator>
      <dc:date>2004-07-21T02:01:19Z</dc:date>
    </item>
    <item>
      <title>Re: replacing text - perl, awk....</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/replacing-text-perl-awk/m-p/3336919#M190008</link>
      <description>Hi Steven,&lt;BR /&gt;&lt;BR /&gt;I have made a mistake, i think you already have seen it.&lt;BR /&gt;&lt;BR /&gt;The statement with /disk2/ is not:&lt;BR /&gt;/disk2/ { if (flag_to==1) $2="disk1_dev" ; flag_to=0}&lt;BR /&gt;&lt;BR /&gt;must be: &lt;BR /&gt;/disk2/ { if (flag_to==1) $2="disk2_dev" ; flag_to=0}&lt;BR /&gt;&lt;BR /&gt;Frank</description>
      <pubDate>Wed, 21 Jul 2004 11:32:08 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/replacing-text-perl-awk/m-p/3336919#M190008</guid>
      <dc:creator>Francisco J. Soler</dc:creator>
      <dc:date>2004-07-21T11:32:08Z</dc:date>
    </item>
    <item>
      <title>Re: replacing text - perl, awk....</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/replacing-text-perl-awk/m-p/3336920#M190009</link>
      <description>&lt;BR /&gt;So do you want that HP always gone, or just sometimes. If always:&lt;BR /&gt;&lt;BR /&gt;$ perl -pe 's;/oracle/HP;_dev/oracle_dev;' old &amp;gt; new&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Hein.&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 21 Jul 2004 12:29:11 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/replacing-text-perl-awk/m-p/3336920#M190009</guid>
      <dc:creator>Hein van den Heuvel</dc:creator>
      <dc:date>2004-07-21T12:29:11Z</dc:date>
    </item>
    <item>
      <title>Re: replacing text - perl, awk....</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/replacing-text-perl-awk/m-p/3336921#M190010</link>
      <description>IF HP always exist,&lt;BR /&gt;sed "s/\/oracle\//\_dev\/oracle_dev\//g" file.txt&lt;BR /&gt;&lt;BR /&gt;regds,&lt;BR /&gt;Abdul.</description>
      <pubDate>Wed, 21 Jul 2004 13:12:10 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/replacing-text-perl-awk/m-p/3336921#M190010</guid>
      <dc:creator>Abdul Rahiman</dc:creator>
      <dc:date>2004-07-21T13:12:10Z</dc:date>
    </item>
  </channel>
</rss>

