<?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: creating a script to change file data in Operating System - OpenVMS</title>
    <link>https://community.hpe.com/t5/operating-system-openvms/creating-a-script-to-change-file-data/m-p/3821332#M10113</link>
    <description>Ahmed,&lt;BR /&gt;&lt;BR /&gt;This is the OpenVMS Forum. If you want a UNIX script, it will be more productive to post this question in one of the UNIX or LINUX forums.&lt;BR /&gt;&lt;BR /&gt;- Bob Gezelter, &lt;A href="http://www.rlgsc.com" target="_blank"&gt;http://www.rlgsc.com&lt;/A&gt;</description>
    <pubDate>Tue, 11 Jul 2006 09:03:57 GMT</pubDate>
    <dc:creator>Robert Gezelter</dc:creator>
    <dc:date>2006-07-11T09:03:57Z</dc:date>
    <item>
      <title>creating a script to change file data</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/creating-a-script-to-change-file-data/m-p/3821330#M10111</link>
      <description>can any one help me create a unix script that will change for me the host name and the ip address in the following files:&lt;BR /&gt;tnsnames.ora &lt;BR /&gt;lister.ora&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 11 Jul 2006 08:44:00 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/creating-a-script-to-change-file-data/m-p/3821330#M10111</guid>
      <dc:creator>Ahmed M. AlShafiy</dc:creator>
      <dc:date>2006-07-11T08:44:00Z</dc:date>
    </item>
    <item>
      <title>Re: creating a script to change file data</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/creating-a-script-to-change-file-data/m-p/3821331#M10112</link>
      <description>Ahmed,&lt;BR /&gt;&lt;BR /&gt;Wrong forum. This is OpenVMS ...&lt;BR /&gt;&lt;BR /&gt;Wim</description>
      <pubDate>Tue, 11 Jul 2006 09:03:45 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/creating-a-script-to-change-file-data/m-p/3821331#M10112</guid>
      <dc:creator>Wim Van den Wyngaert</dc:creator>
      <dc:date>2006-07-11T09:03:45Z</dc:date>
    </item>
    <item>
      <title>Re: creating a script to change file data</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/creating-a-script-to-change-file-data/m-p/3821332#M10113</link>
      <description>Ahmed,&lt;BR /&gt;&lt;BR /&gt;This is the OpenVMS Forum. If you want a UNIX script, it will be more productive to post this question in one of the UNIX or LINUX forums.&lt;BR /&gt;&lt;BR /&gt;- Bob Gezelter, &lt;A href="http://www.rlgsc.com" target="_blank"&gt;http://www.rlgsc.com&lt;/A&gt;</description>
      <pubDate>Tue, 11 Jul 2006 09:03:57 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/creating-a-script-to-change-file-data/m-p/3821332#M10113</guid>
      <dc:creator>Robert Gezelter</dc:creator>
      <dc:date>2006-07-11T09:03:57Z</dc:date>
    </item>
    <item>
      <title>Re: creating a script to change file data</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/creating-a-script-to-change-file-data/m-p/3821333#M10114</link>
      <description>Hello Ahmed,&lt;BR /&gt;&lt;BR /&gt;Welcome to the OPENVMS forums, but you probably wanted to be in some Unix forum.&lt;BR /&gt;&lt;BR /&gt;And you proabbly need to fix listener.ora&lt;BR /&gt;&lt;BR /&gt;Just go into the editor and do it?&lt;BR /&gt;I guess you have to do this on  many systems?&lt;BR /&gt;&lt;BR /&gt;Just use SED -E&lt;BR /&gt;or PERL.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Something along the lines of&lt;BR /&gt;&lt;BR /&gt;perl -pie 's/(\(\s*HOST\s*=\s*)\S+/${1}NEWNAME/i' file&lt;BR /&gt;&lt;BR /&gt;That says&lt;BR /&gt;-p = loop through input and pritn each line when done&lt;BR /&gt;-i = in place replace of output file.&lt;BR /&gt;-e = here comes the progra&lt;BR /&gt;&lt;BR /&gt;Look for and remember () a string that starts with &lt;BR /&gt;- an open param&lt;BR /&gt;- optional whitespace&lt;BR /&gt;- the word HOST&lt;BR /&gt;- optional whitespace &lt;BR /&gt;- and = sign&lt;BR /&gt;- optional whitespace&lt;BR /&gt;and is followed byt some NON-whitespace (\S+)&lt;BR /&gt;&lt;BR /&gt;Replace ( s/x/y/ ) that all of that, but the remembers (HOST= and the new name.&lt;BR /&gt;&lt;BR /&gt;(untested!)&lt;BR /&gt;&lt;BR /&gt;Enjoy,&lt;BR /&gt;Hein,&lt;BR /&gt;</description>
      <pubDate>Tue, 11 Jul 2006 09:05:20 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/creating-a-script-to-change-file-data/m-p/3821333#M10114</guid>
      <dc:creator>Hein van den Heuvel</dc:creator>
      <dc:date>2006-07-11T09:05:20Z</dc:date>
    </item>
  </channel>
</rss>

