Hi all,

When I run the following script I get the above error (ADMIN_DIR not set). However when I run an identical script on another database it runs fine. Does anyone have any idea why it can't set the variable in this one?

Many thanks,
Paula

Code:
#! /bin/ksh
#
# Remove oldest backup
#
cd /backup/houload
ls -l
rm -r `ls -ltr /backup/houload | awk 'NF > 2 {print $9}' | head -1`
ls -l
#
# Set the environment for HOULOAD
#
cd
#
. /opt/bin/oraHOULOAD.env
#
if [[ -z ${ADMIN_DIR} ]]
then
ADMIN_DIR=/opt/bin ; export ADMIN_DIR
fi
#
# Stop java listeners
#
/opt/bin/dbsctl stop HOULOAD
#
# Connect to the database to shut it down
#
sqlplus \/nolog <<EOF
connect / as sysdba
shutdown immediate
exit
EOF
#
# Create backup directory
#
cd /backup/houload
mkdir backup_`date +%d%m%y`
#
# Copy the files 
#
cd /dpp/load/HOULOAD
cp * /backup/houload/backup_`date +%d%m%y`
#
# Connect to the database to start up
#
sqlplus \/nolog <<EOF
connect / as sysdba
startup
exit
EOF
#
# Start the java listeners
#
/opt/bin/dbsctl start HOULOAD
#
# Compress the backup files
#
echo '++++ HOULOAD AVAILABLE ++++'
cd /backup/houload/backup_`date +%d%m%y`
compress *
#
exit