<?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 and replace in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/search-and-replace/m-p/4115793#M313951</link>
    <description>Here's a script that will do exactly what you want with extras. It can be used with STDIN or one or more files. The default mode (no options) is to preview the lines that will be affected with a before and after list. To make the preview permanent, add the -w to write the changes. If you want to suppress the before/after lines, add the -q option and to remove the title and summary lines, use -s (for silent). Examples:&lt;BR /&gt; &lt;BR /&gt;echo "line 1\nline 2" | chgafile -ws line Line&lt;BR /&gt;Line 1&lt;BR /&gt;Line 2&lt;BR /&gt; &lt;BR /&gt;chgafile debug "--&amp;gt; DEBUG &amp;lt;--" myfile&lt;BR /&gt;(previews the changed lines, leaves myfile unchanged)&lt;BR /&gt; &lt;BR /&gt;chgafile -w debug "--&amp;gt; DEBUG &amp;lt;--" myfile&lt;BR /&gt; &lt;BR /&gt;Previews the changes and also writes the changes to myfile.</description>
    <pubDate>Thu, 13 Dec 2007 01:31:47 GMT</pubDate>
    <dc:creator>Bill Hassell</dc:creator>
    <dc:date>2007-12-13T01:31:47Z</dc:date>
    <item>
      <title>Search and replace</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/search-and-replace/m-p/4115790#M313948</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;How to search and replace a particuler word in all the files starting from a particular directory /opt/usr ?&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;Shiv</description>
      <pubDate>Wed, 12 Dec 2007 18:51:21 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/search-and-replace/m-p/4115790#M313948</guid>
      <dc:creator>Shivkumar</dc:creator>
      <dc:date>2007-12-12T18:51:21Z</dc:date>
    </item>
    <item>
      <title>Re: Search and replace</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/search-and-replace/m-p/4115791#M313949</link>
      <description>Hi SHiv:&lt;BR /&gt;&lt;BR /&gt;Simply:&lt;BR /&gt;&lt;BR /&gt;# cd /path &amp;amp;&amp;amp; find . -type f -exec perl -pi -e 's/\bworld\b/shiv/' \+&lt;BR /&gt;&lt;BR /&gt;This would find only *files* in '/path' containing the string "world" and replace it with "shiv".  Only strings bounded by non-word characters (e.g. whitespace) are matched and substituted.  Hence, "hello world" becomes "hello shiv" but "hello worldly" remains unaltered.&lt;BR /&gt;&lt;BR /&gt;If you want to preseve a copy of any files before modification, do:&lt;BR /&gt;&lt;BR /&gt;# # cd /path &amp;amp;&amp;amp; find . -type f -exec perl -pi.old -e 's/\bworld\b/shiv/' \+&lt;BR /&gt;&lt;BR /&gt;...the backup copy of each file will be named with the suffix ".old".&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 12 Dec 2007 19:02:37 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/search-and-replace/m-p/4115791#M313949</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2007-12-12T19:02:37Z</dc:date>
    </item>
    <item>
      <title>Re: Search and replace</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/search-and-replace/m-p/4115792#M313950</link>
      <description>If you need to change the name I would do this:&lt;BR /&gt;create a script with instruction:&lt;BR /&gt;mv $1 `echo $1 | sed s/veinte/treinta/`&lt;BR /&gt;&lt;BR /&gt;and Execute:&lt;BR /&gt;&lt;BR /&gt;find /directory -name *expression* -exec script \{\} \;</description>
      <pubDate>Wed, 12 Dec 2007 19:28:13 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/search-and-replace/m-p/4115792#M313950</guid>
      <dc:creator>Luis Cardenas Perez</dc:creator>
      <dc:date>2007-12-12T19:28:13Z</dc:date>
    </item>
    <item>
      <title>Re: Search and replace</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/search-and-replace/m-p/4115793#M313951</link>
      <description>Here's a script that will do exactly what you want with extras. It can be used with STDIN or one or more files. The default mode (no options) is to preview the lines that will be affected with a before and after list. To make the preview permanent, add the -w to write the changes. If you want to suppress the before/after lines, add the -q option and to remove the title and summary lines, use -s (for silent). Examples:&lt;BR /&gt; &lt;BR /&gt;echo "line 1\nline 2" | chgafile -ws line Line&lt;BR /&gt;Line 1&lt;BR /&gt;Line 2&lt;BR /&gt; &lt;BR /&gt;chgafile debug "--&amp;gt; DEBUG &amp;lt;--" myfile&lt;BR /&gt;(previews the changed lines, leaves myfile unchanged)&lt;BR /&gt; &lt;BR /&gt;chgafile -w debug "--&amp;gt; DEBUG &amp;lt;--" myfile&lt;BR /&gt; &lt;BR /&gt;Previews the changes and also writes the changes to myfile.</description>
      <pubDate>Thu, 13 Dec 2007 01:31:47 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/search-and-replace/m-p/4115793#M313951</guid>
      <dc:creator>Bill Hassell</dc:creator>
      <dc:date>2007-12-13T01:31:47Z</dc:date>
    </item>
    <item>
      <title>Re: Search and replace</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/search-and-replace/m-p/4115794#M313952</link>
      <description>Hi,&lt;BR /&gt;I use this script (no perl used) to change files&lt;BR /&gt;&lt;BR /&gt;HTH,&lt;BR /&gt;Art</description>
      <pubDate>Thu, 13 Dec 2007 09:12:27 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/search-and-replace/m-p/4115794#M313952</guid>
      <dc:creator>Arturo Galbiati</dc:creator>
      <dc:date>2007-12-13T09:12:27Z</dc:date>
    </item>
  </channel>
</rss>

