Bella Thanks for your reply.
I'm trying to display the list of the databases in all the instances in a server using the below script, so i'm first trying to get the list of all the instances in the server (without using db2ilist) but the databases of the symbolic link instances are not being displayed. Please help.
cd /home
ls -d db* > /tmp/instance.list
while read line
do
if [ -e /home/$line/sqllib/db2profile ]; then
. /home/$line/sqllib/db2profile
fi
export DB2INSTANCE=$line
db2 "list db directory" | grep -p Indirect | egrep -i -e "Database name" >> /tmp/DBNAME.list
done </tmp/instance.list