On 1/31/07, kris <[EMAIL PROTECTED]> wrote:

On Wed, Jan 31, 2007 at 02:27:24PM -0500, Dak Ghatikachalam wrote:
>Thanks a lot , I test ran it. This is great

No problem. I should add that if this is to be part of a long running
script, you should close the co-process (the while-loop running cat),
with something like:

exec 5<&p
exec 5<&-



I did not really understand this part of the email

Did you mean that I should

{ while cat /tmp/availdest.$$; do false; done } |&
exec 5<&p

{ while cat file1.txt; do false; done } |&

cat file2.txt |
while read file_b
do
       read -p file_a
       echo $file_b $file_a
done >file3.txt

exec 5<&-

should I do something like this?  will this work ?


-------------

WHen I put this code in large part of the code,  several times it speews out
error like "coprocess already exists"

here is excerpts of the code.

{ while cat /tmp/availdest.$$; do false; done } |&

cat  ${RESTORELINKDIR}/rman_restore_dir/${RESTORENAM}|awk '/DATAFILE/ {
print $0
}'|tr -d ' '|
while read file_b
do
       read -p file_a
       echo $file_b "|" $file_a
done >/tmp/dataf.$$

prev_used="none";
typeset -i initial_cntr=0;
rm -rf /tmp/spaceiss.$$ /tmp/reprocesses.$$ /tmp/availspace.$$
for dbfilerec in `cat  /tmp/dataf.$$|awk '/DATAFILE/ { print $0 }'|tr -d ' '
`
do
               dest_tst=`echo $dbfilerec|awk -F"|" '{print $5}'`
               DISK_MB=`df -k ${dest_tst} | tail -1|awk '{print
int($4/1024)}'`
               echo "Available Disk space = ${DISK_MB} MB"
               Fil_size=`echo $dbfilerec |awk -F"|" '{print int($4)}'`
               echo "Filesize needed  = ${Fil_size} MB"

                        if [ ${DISK_MB} -gt ${Fil_size} ]
FIL_NO=`echo $dbfilerec |awk -F"|" '{print int($2)}'`
                               TARGET_DIR=`echo
"$dest_tst/$DEST_ORA_SID"|tr -d ' '`
                               mkdir -p  ${TARGET_DIR}
                               if [ $? != 0 ]
                               then
                                       SendNotification "For Database
${ORACLE_SID} RMAN backup $RESTOREPRCSLOGDIR Could not be created for
backup"
                               fi
                               strip_dir=`echo $dbfilerec |awk -F"|"
'{print $3}'`
                               TARGET_FILE=`basename $strip_dir|tr -d ' '`
                               perform_actual_restore;
                               prev_used=`echo $dest_tst`

                       fi
                        if [ ${DISK_MB} -le ${Fil_size} ]
                        then
                               echo $dbfilerec|awk -F"|" '{print $5}'
/tmp/spaceiss.$$
                               echo $dbfilerec|awk -F"|"  '/DATAFILE/ {OFS
= "|";$5=""; print}'   >/tmp/reprocesses.$$
                        fi
done

if [ -s /tmp/reprocesses.$$ ]
then
       diff /tmp/availdest.$$ /tmp/spaceiss.$$|awk -F"<" '{print $2}'|awk
NF|tr -d ' '>/tmp/availspace.$$
fi
if [ -s /tmp/availspace.$$ ]
then



but one thing I noticed  was that
_______________________________________________
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "[EMAIL PROTECTED]"

Reply via email to