Hello,
I'm working on automating some database refreshes(clones) and I have to move some files using dd.
This is what I have so far:
for i in `find /orabak/oraclebkups/prod92/ -name "*.dbf" -print`; do
dd if=$i of=/oradata/devl92/$i bs=262144
done
But, I want to just get the file name from the find command and I want to be able to rename the file. For instance, when I run the above find command by itself, this is what I get( I truncated the results):
/orabak/oraclebkups/prod92/system01.dbf
/orabak/oraclebkups/prod92/development_PROD_01.dbf
Now, I want to just grab the filename. I also want to make the PROD become DEVL in any of the filenames that has the word PROD in it.
any help would be greatly appreciated. Thanks,
I'm working on automating some database refreshes(clones) and I have to move some files using dd.
This is what I have so far:
for i in `find /orabak/oraclebkups/prod92/ -name "*.dbf" -print`; do
dd if=$i of=/oradata/devl92/$i bs=262144
done
But, I want to just get the file name from the find command and I want to be able to rename the file. For instance, when I run the above find command by itself, this is what I get( I truncated the results):
/orabak/oraclebkups/prod92/system01.dbf
/orabak/oraclebkups/prod92/development_PROD_01.dbf
Now, I want to just grab the filename. I also want to make the PROD become DEVL in any of the filenames that has the word PROD in it.
any help would be greatly appreciated. Thanks,