<?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: multi file substitution script in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/multi-file-substitution-script/m-p/3213143#M168908</link>
    <description>Karthik did a typo,&lt;BR /&gt; &lt;BR /&gt;The line &lt;BR /&gt; &lt;BR /&gt;sed s/SUIVI\/command/SUIVI\/xxx\/command/g &amp;gt; $file.new&lt;BR /&gt; &lt;BR /&gt;should be&lt;BR /&gt; &lt;BR /&gt;sed "s/SUIVI\/command/SUIVI\/xxx\/command/g" $file &amp;gt; $file.new</description>
    <pubDate>Tue, 09 Mar 2004 06:06:31 GMT</pubDate>
    <dc:creator>Mark Grant</dc:creator>
    <dc:date>2004-03-09T06:06:31Z</dc:date>
    <item>
      <title>multi file substitution script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/multi-file-substitution-script/m-p/3213141#M168906</link>
      <description>Hi everybody.&lt;BR /&gt;&lt;BR /&gt;Does anybody can suggest me a shell script (or awk) to make automatic substitution in many files?&lt;BR /&gt;&lt;BR /&gt;For Example:&lt;BR /&gt;&lt;BR /&gt;I have many text files (shell script) with the command "SUIVI/command" and I want to change the string in EVERY file to make it become "SUIVI/xxx/command" or something similar.&lt;BR /&gt;&lt;BR /&gt;Can anybody help me?&lt;BR /&gt;&lt;BR /&gt;thanks in advance.</description>
      <pubDate>Tue, 09 Mar 2004 05:49:35 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/multi-file-substitution-script/m-p/3213141#M168906</guid>
      <dc:creator>massimo_38</dc:creator>
      <dc:date>2004-03-09T05:49:35Z</dc:date>
    </item>
    <item>
      <title>Re: multi file substitution script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/multi-file-substitution-script/m-p/3213142#M168907</link>
      <description>You can use sed for this. &lt;BR /&gt;&lt;BR /&gt;Something like this,&lt;BR /&gt;&lt;BR /&gt;for file in `file1 file2 ...`&lt;BR /&gt;do&lt;BR /&gt;sed s/SUIVI\/command/SUIVI\/xxx\/command/g &amp;gt; $file.new&lt;BR /&gt;mv $file $file.org&lt;BR /&gt;mv $file.new $file&lt;BR /&gt;done&lt;BR /&gt;&lt;BR /&gt;I have not tried this though ;-)&lt;BR /&gt;&lt;BR /&gt;-KarthiK S S</description>
      <pubDate>Tue, 09 Mar 2004 05:54:28 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/multi-file-substitution-script/m-p/3213142#M168907</guid>
      <dc:creator>Karthik S S</dc:creator>
      <dc:date>2004-03-09T05:54:28Z</dc:date>
    </item>
    <item>
      <title>Re: multi file substitution script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/multi-file-substitution-script/m-p/3213143#M168908</link>
      <description>Karthik did a typo,&lt;BR /&gt; &lt;BR /&gt;The line &lt;BR /&gt; &lt;BR /&gt;sed s/SUIVI\/command/SUIVI\/xxx\/command/g &amp;gt; $file.new&lt;BR /&gt; &lt;BR /&gt;should be&lt;BR /&gt; &lt;BR /&gt;sed "s/SUIVI\/command/SUIVI\/xxx\/command/g" $file &amp;gt; $file.new</description>
      <pubDate>Tue, 09 Mar 2004 06:06:31 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/multi-file-substitution-script/m-p/3213143#M168908</guid>
      <dc:creator>Mark Grant</dc:creator>
      <dc:date>2004-03-09T06:06:31Z</dc:date>
    </item>
    <item>
      <title>Re: multi file substitution script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/multi-file-substitution-script/m-p/3213144#M168909</link>
      <description>Give this a try :-&lt;BR /&gt;&lt;BR /&gt;#cat test | sed s/SUIVI\\/command/SUIVI\\/xxx\\/command/g &amp;gt; test.out&lt;BR /&gt;#mv test.out test&lt;BR /&gt;&lt;BR /&gt;You could then put it in a loop :-&lt;BR /&gt;&lt;BR /&gt;for file in test1 test2 test3&lt;BR /&gt;do&lt;BR /&gt;cat $file | sed s/SUIVI\\/command/SUIVI\\/xxx\\/command/g &amp;gt; $file.out&lt;BR /&gt;mv $file.out $file&lt;BR /&gt;done&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;&lt;BR /&gt;Dave.</description>
      <pubDate>Tue, 09 Mar 2004 06:07:37 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/multi-file-substitution-script/m-p/3213144#M168909</guid>
      <dc:creator>David Burgess</dc:creator>
      <dc:date>2004-03-09T06:07:37Z</dc:date>
    </item>
    <item>
      <title>Re: multi file substitution script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/multi-file-substitution-script/m-p/3213145#M168910</link>
      <description>How about a really quick one&lt;BR /&gt; &lt;BR /&gt;perl -pi -e "s/SUIVI\/command/SUIVI\/xxx\/command" file*&lt;BR /&gt; &lt;BR /&gt;The xxx could be replaced with a shell variable if you put this in a script and it's useful for you to do that.  The file* is a list of files.</description>
      <pubDate>Tue, 09 Mar 2004 06:20:42 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/multi-file-substitution-script/m-p/3213145#M168910</guid>
      <dc:creator>Mark Grant</dc:creator>
      <dc:date>2004-03-09T06:20:42Z</dc:date>
    </item>
    <item>
      <title>Re: multi file substitution script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/multi-file-substitution-script/m-p/3213146#M168911</link>
      <description>Thansk to all....I'm trying the perl command for now...&lt;BR /&gt;&lt;BR /&gt;It gives me this error:&lt;BR /&gt;&lt;BR /&gt;Substitution replacement not terminated at -e line 1.&lt;BR /&gt;&lt;BR /&gt;What am I doing wrong?</description>
      <pubDate>Tue, 09 Mar 2004 06:37:20 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/multi-file-substitution-script/m-p/3213146#M168911</guid>
      <dc:creator>massimo_38</dc:creator>
      <dc:date>2004-03-09T06:37:20Z</dc:date>
    </item>
    <item>
      <title>Re: multi file substitution script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/multi-file-substitution-script/m-p/3213147#M168912</link>
      <description>You are doing nothing wrong.  I did though.&lt;BR /&gt; &lt;BR /&gt;The line should read&lt;BR /&gt; &lt;BR /&gt;perl -pi -e "s/SUIVI\/command/SUIVI\/xxx\/command/" file*&lt;BR /&gt; &lt;BR /&gt;I missed out that last "/" - sorry</description>
      <pubDate>Tue, 09 Mar 2004 06:40:57 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/multi-file-substitution-script/m-p/3213147#M168912</guid>
      <dc:creator>Mark Grant</dc:creator>
      <dc:date>2004-03-09T06:40:57Z</dc:date>
    </item>
    <item>
      <title>Re: multi file substitution script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/multi-file-substitution-script/m-p/3213148#M168913</link>
      <description>Change the command to,&lt;BR /&gt;&lt;BR /&gt;perl -pi -e "s/SUIVI\/command/SUIVI\/xxx\/command/g" file*&lt;BR /&gt;&lt;BR /&gt;-Karthik S S</description>
      <pubDate>Tue, 09 Mar 2004 06:41:49 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/multi-file-substitution-script/m-p/3213148#M168913</guid>
      <dc:creator>Karthik S S</dc:creator>
      <dc:date>2004-03-09T06:41:49Z</dc:date>
    </item>
    <item>
      <title>Re: multi file substitution script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/multi-file-substitution-script/m-p/3213149#M168914</link>
      <description>thanks to all!&lt;BR /&gt;You resolved my problem.&lt;BR /&gt;&lt;BR /&gt;I used the perl command and the sed command in automatic batch...&lt;BR /&gt;&lt;BR /&gt;Now I submit points.&lt;BR /&gt;&lt;BR /&gt;By!</description>
      <pubDate>Tue, 09 Mar 2004 08:39:24 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/multi-file-substitution-script/m-p/3213149#M168914</guid>
      <dc:creator>massimo_38</dc:creator>
      <dc:date>2004-03-09T08:39:24Z</dc:date>
    </item>
  </channel>
</rss>

