export P5FileName=${T_LOG}/PDB5fileNameTarget.txt
export CurP5FileName=${T_LOG}/PDB5fileNameTarget_T2.txt
export renameScript=${T_LOG}/PDB5rename.sql
generateSQLscript()
{
File1=$1
File2=$2
while
IFS=” ” read -r x rest <&3
IFS=” ” read -r y rest <&4
do
echo “alter database rename file ‘$x’ to ‘$y’; “
done 3<${File1} 4< ${File2}
}
generateSQLscript ${CurP5FileName} ${P5FileName} > ${renameScript}
echo “The rename script for PDB5 is :”
cat ${renameScript}
eg.
echo "1 1 1" > tmp1
echo "2 2 2" >> tmp1
echo "3 3 3" >> tmp1
echo "a,b,c" > tmp2
echo "a,b,c" >> tmp2
echo "a,b,c" >> tmp2
while
IFS=" " read -r x rest <&3
IFS="," read -r y z rest <&4
do
echo "$x:$y:$z"
done 3<tmp1 4<tmp2
1:a:b
2:a:b
3:a:b