<?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: Scripting help reqd in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/scripting-help-reqd/m-p/3240291#M173563</link>
    <description>something like this should do it. &lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;for prd in `ls /oracle/TRN/saparch`&lt;BR /&gt;do&lt;BR /&gt;trn=`echo $prd | sed 's/PRD/TRN/'`&lt;BR /&gt;mv $prd $trn&lt;BR /&gt;done&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
    <pubDate>Mon, 05 Apr 2004 16:47:09 GMT</pubDate>
    <dc:creator>Marvin Strong</dc:creator>
    <dc:date>2004-04-05T16:47:09Z</dc:date>
    <item>
      <title>Scripting help reqd</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/scripting-help-reqd/m-p/3240288#M173560</link>
      <description>Hi guys,&lt;BR /&gt;            I have a set of files in a directory they are archieves from Oracle for eg;&lt;BR /&gt;*********************************************&lt;BR /&gt;/oracle/TRN/saparch&lt;BR /&gt;#ls -ltr&lt;BR /&gt;PRDarch1_32690.dbf&lt;BR /&gt;PRDarch1_32691.dbf&lt;BR /&gt;PRDarch1_32692.dbf&lt;BR /&gt;**********************************************&lt;BR /&gt;What I want to do is to rename the first 3 characters ie "PRD" to "TRN" and the rest of the things would remain the same so the out put would be&lt;BR /&gt;&lt;BR /&gt;TRNarch1_32690.dbf&lt;BR /&gt;TRNarch1_32691.dbf&lt;BR /&gt;TRNarch1_32692.dbf&lt;BR /&gt;&lt;BR /&gt;Is there a way to script it out?&lt;BR /&gt;&lt;BR /&gt;Thnks&lt;BR /&gt;SK&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Mon, 05 Apr 2004 16:24:18 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/scripting-help-reqd/m-p/3240288#M173560</guid>
      <dc:creator>ShivKumar_1</dc:creator>
      <dc:date>2004-04-05T16:24:18Z</dc:date>
    </item>
    <item>
      <title>Re: Scripting help reqd</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/scripting-help-reqd/m-p/3240289#M173561</link>
      <description>Hi,&lt;BR /&gt;Try the following:&lt;BR /&gt;#!/usr/bin/sh&lt;BR /&gt;cd DIRN&lt;BR /&gt;OLD=PRD&lt;BR /&gt;NEW=TRN&lt;BR /&gt;&lt;BR /&gt;ls -1 ${OLD}*| while read FILENAME; do&lt;BR /&gt;NEWN=$(echo $FILENAME|sed "s/^$OLD/$NEW/")&lt;BR /&gt;mv $FILENAME $NEWN&lt;BR /&gt;done&lt;BR /&gt;</description>
      <pubDate>Mon, 05 Apr 2004 16:36:46 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/scripting-help-reqd/m-p/3240289#M173561</guid>
      <dc:creator>Victor Fridyev</dc:creator>
      <dc:date>2004-04-05T16:36:46Z</dc:date>
    </item>
    <item>
      <title>Re: Scripting help reqd</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/scripting-help-reqd/m-p/3240290#M173562</link>
      <description>Of course there is a way to script this but I think it does you more harm than good to give you a full solution. This is really basic scripting that any admin should learn to do:&lt;BR /&gt;&lt;BR /&gt;I'll get you started:&lt;BR /&gt;&lt;BR /&gt;cd /oracle/TRN/saparch&lt;BR /&gt;ls PRDarch*.dbf | while read X&lt;BR /&gt;do&lt;BR /&gt;  NEW=$(echo "${X}" | sed 's/^PRD/TRN/')&lt;BR /&gt;  echo "${X} -&amp;gt; ${NEW}"&lt;BR /&gt;  mv "${X}" "${NEW}"&lt;BR /&gt;done&lt;BR /&gt;&lt;BR /&gt;I would probably add some testing to make sure that the new files does not already exist before doing the mv. The quotes are important because your filenames might contain whitespace.&lt;BR /&gt;</description>
      <pubDate>Mon, 05 Apr 2004 16:44:15 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/scripting-help-reqd/m-p/3240290#M173562</guid>
      <dc:creator>A. Clay Stephenson</dc:creator>
      <dc:date>2004-04-05T16:44:15Z</dc:date>
    </item>
    <item>
      <title>Re: Scripting help reqd</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/scripting-help-reqd/m-p/3240291#M173563</link>
      <description>something like this should do it. &lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;for prd in `ls /oracle/TRN/saparch`&lt;BR /&gt;do&lt;BR /&gt;trn=`echo $prd | sed 's/PRD/TRN/'`&lt;BR /&gt;mv $prd $trn&lt;BR /&gt;done&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Mon, 05 Apr 2004 16:47:09 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/scripting-help-reqd/m-p/3240291#M173563</guid>
      <dc:creator>Marvin Strong</dc:creator>
      <dc:date>2004-04-05T16:47:09Z</dc:date>
    </item>
    <item>
      <title>Re: Scripting help reqd</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/scripting-help-reqd/m-p/3240292#M173564</link>
      <description>Hi guys&lt;BR /&gt;         Thnks for the quick response.&lt;BR /&gt;&lt;BR /&gt;Pl close this form.&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Mon, 05 Apr 2004 16:48:08 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/scripting-help-reqd/m-p/3240292#M173564</guid>
      <dc:creator>ShivKumar_1</dc:creator>
      <dc:date>2004-04-05T16:48:08Z</dc:date>
    </item>
    <item>
      <title>Re: Scripting help reqd</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/scripting-help-reqd/m-p/3240293#M173565</link>
      <description>Is this realy what you want to do?&lt;BR /&gt;These are oracle's offline redolog files.&lt;BR /&gt;Changeing their name will make them invisible for oracle in case you need to recover your database.&lt;BR /&gt;Also the SAP tool brarchive won't be able to back them up.&lt;BR /&gt;If you've renamed your database/SAP instance you should also adjust the naming of you offline redo logfiles in $ORACLE_HOME/dbs/init&lt;SID&gt;.ora :&lt;BR /&gt;&lt;BR /&gt;log_archive_dest='/oracle/TRN/oraarch/TRNarch'&lt;BR /&gt;&lt;BR /&gt;regards,&lt;BR /&gt;&lt;BR /&gt;Bart&lt;/SID&gt;</description>
      <pubDate>Tue, 06 Apr 2004 04:02:27 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/scripting-help-reqd/m-p/3240293#M173565</guid>
      <dc:creator>Bart Paulusse</dc:creator>
      <dc:date>2004-04-06T04:02:27Z</dc:date>
    </item>
    <item>
      <title>Re: Scripting help reqd</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/scripting-help-reqd/m-p/3240294#M173566</link>
      <description>Hi bart,&lt;BR /&gt;          Thnks for your suggestion. The thing is we are doing a rcp from our production server to another server. So , the names need to be different in another system. &lt;BR /&gt; &lt;BR /&gt;Thnks&lt;BR /&gt;SK</description>
      <pubDate>Tue, 06 Apr 2004 11:56:07 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/scripting-help-reqd/m-p/3240294#M173566</guid>
      <dc:creator>ShivKumar_1</dc:creator>
      <dc:date>2004-04-06T11:56:07Z</dc:date>
    </item>
    <item>
      <title>Re: Scripting help reqd</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/scripting-help-reqd/m-p/3240295#M173567</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;if you've renamed your database after the rcp to oyou will have pen your database with the RESETLOGS option. This means that old offline redolog files are unuseable.&lt;BR /&gt;&lt;BR /&gt;If this is the case you can delete the old offline redologfiles instead of renaming them.&lt;BR /&gt;&lt;BR /&gt;regards,&lt;BR /&gt;&lt;BR /&gt;Bart</description>
      <pubDate>Wed, 07 Apr 2004 03:59:39 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/scripting-help-reqd/m-p/3240295#M173567</guid>
      <dc:creator>Bart Paulusse</dc:creator>
      <dc:date>2004-04-07T03:59:39Z</dc:date>
    </item>
  </channel>
</rss>

