Hi,
I am trying to concatenate the output of a while loop to a $message variable that will be printed once the loop has completed, but as it stands, it returns nothing from the inside $message variable.
I am currently not very interested in the else condition. As long as $inexistent has contained any value, I want $message to report on the list at the end. If none are listed, I will set a message to say that "Everything is hunky dory".
##################################################################
if [ ! -f ${oratab} ]
then
print "em_result=there is no oratab found in $oratab"
exit
else
awk -F":" '{ print $2 }' $oratab | while read line
do
if [ ! -f "${line}/network/admin/sqlnet.ora" ];
then
inexistent="${line}/network/admin"
route="${route} ${inexistent}, "
message="No sqlnet.ora file found in the following directories: ${route}."
else
existent=""${line}"/network/admin"
route2="${route2} ${existent}, "
message="An sqlnet.ora file was found in ${route2}"
exit
fi
done
print $message
fi
exit
#################################################################
Can anyone help with this?
Thanks in advance!
Regards,
T.
I am trying to concatenate the output of a while loop to a $message variable that will be printed once the loop has completed, but as it stands, it returns nothing from the inside $message variable.
I am currently not very interested in the else condition. As long as $inexistent has contained any value, I want $message to report on the list at the end. If none are listed, I will set a message to say that "Everything is hunky dory".
##################################################################
if [ ! -f ${oratab} ]
then
print "em_result=there is no oratab found in $oratab"
exit
else
awk -F":" '{ print $2 }' $oratab | while read line
do
if [ ! -f "${line}/network/admin/sqlnet.ora" ];
then
inexistent="${line}/network/admin"
route="${route} ${inexistent}, "
message="No sqlnet.ora file found in the following directories: ${route}."
else
existent=""${line}"/network/admin"
route2="${route2} ${existent}, "
message="An sqlnet.ora file was found in ${route2}"
exit
fi
done
print $message
fi
exit
#################################################################
Can anyone help with this?
Thanks in advance!
Regards,
T.