<?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 Help me in shell scripting in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/help-me-in-shell-scripting/m-p/3873438#M773602</link>
    <description>Hi .,&lt;BR /&gt;&lt;BR /&gt;I want to grep a pattern in my file and want to replace it with a new one.&lt;BR /&gt; &lt;BR /&gt;Here is the line where i need to modify&lt;BR /&gt;&lt;BR /&gt;multimediaGroup type="media" dbid="525" &lt;BR /&gt;&lt;BR /&gt;I want to replace the dbid value from 525 to 635 and how can i able to do it.&lt;BR /&gt;&lt;BR /&gt;How can I write a script to read my file and grep the pattern 525 and get new input from me as 635 , then make it as modification .So finally I need that my file should have the entry as follows..&lt;BR /&gt;&lt;BR /&gt;multimediaGroup type="media" dbid="635"&lt;BR /&gt;&lt;BR /&gt;AnyBody well in scripting can help me..&lt;BR /&gt;&lt;BR /&gt;Thanks &amp;amp; regards&lt;BR /&gt;Suseendran .A&lt;BR /&gt;</description>
    <pubDate>Tue, 03 Oct 2006 02:57:11 GMT</pubDate>
    <dc:creator>Virumandi</dc:creator>
    <dc:date>2006-10-03T02:57:11Z</dc:date>
    <item>
      <title>Help me in shell scripting</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/help-me-in-shell-scripting/m-p/3873438#M773602</link>
      <description>Hi .,&lt;BR /&gt;&lt;BR /&gt;I want to grep a pattern in my file and want to replace it with a new one.&lt;BR /&gt; &lt;BR /&gt;Here is the line where i need to modify&lt;BR /&gt;&lt;BR /&gt;multimediaGroup type="media" dbid="525" &lt;BR /&gt;&lt;BR /&gt;I want to replace the dbid value from 525 to 635 and how can i able to do it.&lt;BR /&gt;&lt;BR /&gt;How can I write a script to read my file and grep the pattern 525 and get new input from me as 635 , then make it as modification .So finally I need that my file should have the entry as follows..&lt;BR /&gt;&lt;BR /&gt;multimediaGroup type="media" dbid="635"&lt;BR /&gt;&lt;BR /&gt;AnyBody well in scripting can help me..&lt;BR /&gt;&lt;BR /&gt;Thanks &amp;amp; regards&lt;BR /&gt;Suseendran .A&lt;BR /&gt;</description>
      <pubDate>Tue, 03 Oct 2006 02:57:11 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/help-me-in-shell-scripting/m-p/3873438#M773602</guid>
      <dc:creator>Virumandi</dc:creator>
      <dc:date>2006-10-03T02:57:11Z</dc:date>
    </item>
    <item>
      <title>Re: Help me in shell scripting</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/help-me-in-shell-scripting/m-p/3873439#M773603</link>
      <description>Hi,&lt;BR /&gt;how about:&lt;BR /&gt;sed "1,$ s/525/635/g" input.dat &amp;gt; output.dat&lt;BR /&gt;&lt;BR /&gt; Please note, this replace ALL occurances of 525 with 635.&lt;BR /&gt;</description>
      <pubDate>Tue, 03 Oct 2006 03:06:50 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/help-me-in-shell-scripting/m-p/3873439#M773603</guid>
      <dc:creator>Peter Godron</dc:creator>
      <dc:date>2006-10-03T03:06:50Z</dc:date>
    </item>
    <item>
      <title>Re: Help me in shell scripting</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/help-me-in-shell-scripting/m-p/3873440#M773604</link>
      <description>No I dont want mu script to change all occurance&lt;BR /&gt;&lt;BR /&gt;It want to tale bid  number as a reference and to replace the ID value..&lt;BR /&gt;&lt;BR /&gt;I got a Solution for the above by the following script&lt;BR /&gt;&lt;BR /&gt;sed -e 's/multimediaGroup type="media" dbid="525"/multimediaGroup type="media" dbid="635"/' file &amp;gt;/tmp/tmpfile.$$&lt;BR /&gt;&lt;BR /&gt;Thanks for the help...</description>
      <pubDate>Tue, 03 Oct 2006 03:13:56 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/help-me-in-shell-scripting/m-p/3873440#M773604</guid>
      <dc:creator>Virumandi</dc:creator>
      <dc:date>2006-10-03T03:13:56Z</dc:date>
    </item>
    <item>
      <title>Re: Help me in shell scripting</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/help-me-in-shell-scripting/m-p/3873441#M773605</link>
      <description>Hi,&lt;BR /&gt;can you please close this thread, as you have already raised the follow-on ones ;-)&lt;BR /&gt;&lt;BR /&gt;Rather than have multiple threads, it may be better to detail the actual problem and let people provide a better (complete) solution.&lt;BR /&gt;</description>
      <pubDate>Tue, 03 Oct 2006 07:13:22 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/help-me-in-shell-scripting/m-p/3873441#M773605</guid>
      <dc:creator>Peter Godron</dc:creator>
      <dc:date>2006-10-03T07:13:22Z</dc:date>
    </item>
    <item>
      <title>Re: Help me in shell scripting</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/help-me-in-shell-scripting/m-p/3873442#M773606</link>
      <description>Hey;&lt;BR /&gt;&lt;BR /&gt;perl -pli -e '/(multimediaGroup type="media" dbid=)"525"/\1"635"/g' ${file} &lt;BR /&gt;&lt;BR /&gt;should do the trick.  It'll update the file(s) in place so no need to move temporary files back into place.&lt;BR /&gt;&lt;BR /&gt;One thing I will usually do is skip the i argument for the first run:&lt;BR /&gt;&lt;BR /&gt;perl -pl -e '/(multimediaGroup type="media" dbid=)"525"/\1"635"/g' ${file} | grep 635&lt;BR /&gt;&lt;BR /&gt;to verify *ONLY* the lines you're looking for are affected.  If that looks good, add the -i argument and your files will get updated.&lt;BR /&gt;&lt;BR /&gt;HTH;&lt;BR /&gt;&lt;BR /&gt;Doug</description>
      <pubDate>Tue, 03 Oct 2006 07:22:42 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/help-me-in-shell-scripting/m-p/3873442#M773606</guid>
      <dc:creator>Doug O'Leary</dc:creator>
      <dc:date>2006-10-03T07:22:42Z</dc:date>
    </item>
  </channel>
</rss>

