I have generated a file list which contains files (not directories) with the full path preceeding them, eg:
/oracledata/EDI/control01.ctl
/oracledata/EDI/EDI.dbf
/oracleindex/EDI/control02.ctl
/redolog1/EDI/redo01.log
/oracle/app/oracle/oradata/EDI/system01.dbf
/oracle/app/oracle/oradata/EDI/temp01.dbf
From that list i would like to create two new files, but deleting any line which has temp*.dbf and arranging the format, so...
(/backuploc is in a variable
TOBEDECIDED is in a variable)
file1:
cp -p /oracledata/EDI/control01.ctl /backuploc/oracledata/EDI/control01.ctl
cp -p /oracledata/EDI/EDI.dbf /backuploc/oracledata/EDI/EDI.dbf
cp -p /oracleindex/EDI/control02.ctl /backuploc/oracleindex/EDI/control02.ctl
cp -p /redolog1/EDI/redo01.log /backuploc/redolog1/EDI/redo01.log
cp -p /oracle/app/oracle/oradata/EDI/system01.dbf /backuploc/oracle/app/oracle/oradata/EDI/system01.dbf
file2:
cp -p /backuploc/oracledata/EDI/control01.ctl /oracledata/TOBEDECIDED/control01.ctl
cp -p /backuploc/oracledata/EDI/EDI.dbf /oracledata/TOBEDECIDED/TOBEDECIDED.dbf
cp -p /backuploc/oracleindex/EDI/control02.ctl /oracleindex/TOBEDECIDED/control02.ctl
cp -p /backuploc/redolog1/EDI/redo01.log /redolog1/TOBEDECIDED/redo01.log
cp -p /backuploc/oracle/app/oracle/oradata/EDI/system01.dbf /oracle/app/oracle/oradata/TOBEDECIDED/system01.dbf
Later, when a restore script is run I'd like to change "TOBEDECIDED" to be a selected value, so another find/replace.
Applications Support
UK
/oracledata/EDI/control01.ctl
/oracledata/EDI/EDI.dbf
/oracleindex/EDI/control02.ctl
/redolog1/EDI/redo01.log
/oracle/app/oracle/oradata/EDI/system01.dbf
/oracle/app/oracle/oradata/EDI/temp01.dbf
From that list i would like to create two new files, but deleting any line which has temp*.dbf and arranging the format, so...
(/backuploc is in a variable
TOBEDECIDED is in a variable)
file1:
cp -p /oracledata/EDI/control01.ctl /backuploc/oracledata/EDI/control01.ctl
cp -p /oracledata/EDI/EDI.dbf /backuploc/oracledata/EDI/EDI.dbf
cp -p /oracleindex/EDI/control02.ctl /backuploc/oracleindex/EDI/control02.ctl
cp -p /redolog1/EDI/redo01.log /backuploc/redolog1/EDI/redo01.log
cp -p /oracle/app/oracle/oradata/EDI/system01.dbf /backuploc/oracle/app/oracle/oradata/EDI/system01.dbf
file2:
cp -p /backuploc/oracledata/EDI/control01.ctl /oracledata/TOBEDECIDED/control01.ctl
cp -p /backuploc/oracledata/EDI/EDI.dbf /oracledata/TOBEDECIDED/TOBEDECIDED.dbf
cp -p /backuploc/oracleindex/EDI/control02.ctl /oracleindex/TOBEDECIDED/control02.ctl
cp -p /backuploc/redolog1/EDI/redo01.log /redolog1/TOBEDECIDED/redo01.log
cp -p /backuploc/oracle/app/oracle/oradata/EDI/system01.dbf /oracle/app/oracle/oradata/TOBEDECIDED/system01.dbf
Later, when a restore script is run I'd like to change "TOBEDECIDED" to be a selected value, so another find/replace.
Applications Support
UK