<?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: vi : can i execute a substitution at shell prompt? in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/vi-can-i-execute-a-substitution-at-shell-prompt/m-p/2460172#M771812</link>
    <description>Download a command "rpl"  from hpux porting center. It is very handy command.</description>
    <pubDate>Wed, 01 Nov 2000 18:49:36 GMT</pubDate>
    <dc:creator>Sid Shapiro</dc:creator>
    <dc:date>2000-11-01T18:49:36Z</dc:date>
    <item>
      <title>vi : can i execute a substitution at shell prompt?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/vi-can-i-execute-a-substitution-at-shell-prompt/m-p/2460167#M771807</link>
      <description>I need to substitude a certain string of files under a specific directory. for instance, in *.c, a string &lt;BR /&gt;#include &lt;STRING.H&gt; &lt;BR /&gt;need to be changed to &lt;BR /&gt;#include &lt;STRING.H&gt;&lt;BR /&gt;&lt;BR /&gt;Can I kind of combine "find", "grep" and "vi"=&amp;gt;&lt;BR /&gt;:1,$s/string.h/String.h/g &lt;BR /&gt;to accomplish it?&lt;BR /&gt;&lt;BR /&gt;Please help. Thank you.&lt;BR /&gt;&lt;BR /&gt;Jessica&lt;BR /&gt;&lt;BR /&gt;&lt;/STRING.H&gt;&lt;/STRING.H&gt;</description>
      <pubDate>Wed, 01 Nov 2000 05:08:36 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/vi-can-i-execute-a-substitution-at-shell-prompt/m-p/2460167#M771807</guid>
      <dc:creator>Jessica Chou</dc:creator>
      <dc:date>2000-11-01T05:08:36Z</dc:date>
    </item>
    <item>
      <title>Re: vi : can i execute a substitution at shell prompt?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/vi-can-i-execute-a-substitution-at-shell-prompt/m-p/2460168#M771808</link>
      <description>Jessica : &lt;BR /&gt;  Please find attached the script which does the same thing what you wanted. I think this is the cleaner way than using vi to do the job. &lt;BR /&gt;&lt;BR /&gt;Hope this helps. &lt;BR /&gt;&lt;BR /&gt;PS: Use the Script as&lt;BR /&gt;# t.sh *.c &lt;S-STRING&gt; &lt;R-STRING&gt;&lt;BR /&gt;&lt;BR /&gt;Enjoy !&lt;BR /&gt;&lt;/R-STRING&gt;&lt;/S-STRING&gt;</description>
      <pubDate>Wed, 01 Nov 2000 06:29:53 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/vi-can-i-execute-a-substitution-at-shell-prompt/m-p/2460168#M771808</guid>
      <dc:creator>Madhu Sudhan_1</dc:creator>
      <dc:date>2000-11-01T06:29:53Z</dc:date>
    </item>
    <item>
      <title>Re: vi : can i execute a substitution at shell prompt?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/vi-can-i-execute-a-substitution-at-shell-prompt/m-p/2460169#M771809</link>
      <description>you can do it this way:&lt;BR /&gt;&lt;BR /&gt;re=string.h&lt;BR /&gt;sub_re=String.h&lt;BR /&gt;&lt;BR /&gt;find your_dir -name "*.h" |&lt;BR /&gt;while read filename&lt;BR /&gt;do&lt;BR /&gt;ex -sc "1,$ s/$re/$sub_re/g | wq" $filename&lt;BR /&gt;done&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 01 Nov 2000 06:48:06 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/vi-can-i-execute-a-substitution-at-shell-prompt/m-p/2460169#M771809</guid>
      <dc:creator>curt larson</dc:creator>
      <dc:date>2000-11-01T06:48:06Z</dc:date>
    </item>
    <item>
      <title>Re: vi : can i execute a substitution at shell prompt?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/vi-can-i-execute-a-substitution-at-shell-prompt/m-p/2460170#M771810</link>
      <description>Jessica:&lt;BR /&gt;  A small note to you.  Use the script as&lt;BR /&gt;&lt;BR /&gt;# t.sh *.c &lt;SEARCH-STRING&gt; &lt;REPLACE-STRING&gt;&lt;BR /&gt;&lt;BR /&gt;You have to use "" to negate the what shell has about it. &lt;BR /&gt;&lt;BR /&gt;......Madhu&lt;BR /&gt;&lt;BR /&gt;&lt;/REPLACE-STRING&gt;&lt;/SEARCH-STRING&gt;</description>
      <pubDate>Wed, 01 Nov 2000 17:23:42 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/vi-can-i-execute-a-substitution-at-shell-prompt/m-p/2460170#M771810</guid>
      <dc:creator>Madhu Sudhan_1</dc:creator>
      <dc:date>2000-11-01T17:23:42Z</dc:date>
    </item>
    <item>
      <title>Re: vi : can i execute a substitution at shell prompt?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/vi-can-i-execute-a-substitution-at-shell-prompt/m-p/2460171#M771811</link>
      <description>Iam trying to put a backward slash and it is not getting printed in the post.</description>
      <pubDate>Wed, 01 Nov 2000 18:04:19 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/vi-can-i-execute-a-substitution-at-shell-prompt/m-p/2460171#M771811</guid>
      <dc:creator>Madhu Sudhan_1</dc:creator>
      <dc:date>2000-11-01T18:04:19Z</dc:date>
    </item>
    <item>
      <title>Re: vi : can i execute a substitution at shell prompt?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/vi-can-i-execute-a-substitution-at-shell-prompt/m-p/2460172#M771812</link>
      <description>Download a command "rpl"  from hpux porting center. It is very handy command.</description>
      <pubDate>Wed, 01 Nov 2000 18:49:36 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/vi-can-i-execute-a-substitution-at-shell-prompt/m-p/2460172#M771812</guid>
      <dc:creator>Sid Shapiro</dc:creator>
      <dc:date>2000-11-01T18:49:36Z</dc:date>
    </item>
    <item>
      <title>Re: vi : can i execute a substitution at shell prompt?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/vi-can-i-execute-a-substitution-at-shell-prompt/m-p/2460173#M771813</link>
      <description>Curt's suggestion of using 'ex' is probably the fastest way of doing it with tools you already have on your system, and *without* creating any intermediate files. Just be very sure the syntax of your substitution ("1,$s/this/that") command is correct before hitting the 'Enter' key, as you would have no way of going back if you make a mistake.&lt;BR /&gt;&lt;BR /&gt;Madhu's script uses 'sed,' which cannot modify the files directly, but uses an intermediate file to store the results before overwriting the original file. As an added safety net, you could modify his script so that the intermediate file is preserved (so you can verify the changes), and the original file is left untouched.</description>
      <pubDate>Thu, 02 Nov 2000 18:36:05 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/vi-can-i-execute-a-substitution-at-shell-prompt/m-p/2460173#M771813</guid>
      <dc:creator>Kevin Ernst</dc:creator>
      <dc:date>2000-11-02T18:36:05Z</dc:date>
    </item>
    <item>
      <title>Re: vi : can i execute a substitution at shell prompt?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/vi-can-i-execute-a-substitution-at-shell-prompt/m-p/2460174#M771814</link>
      <description>Thanks Kevin,  Your point noted.&lt;BR /&gt;&lt;BR /&gt;......Madhu</description>
      <pubDate>Thu, 02 Nov 2000 19:56:14 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/vi-can-i-execute-a-substitution-at-shell-prompt/m-p/2460174#M771814</guid>
      <dc:creator>Madhu Sudhan_1</dc:creator>
      <dc:date>2000-11-02T19:56:14Z</dc:date>
    </item>
  </channel>
</rss>

