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.
ls -d db* > /tmp/instance.list
while read line
if [ -e /home/$line/sqllib/db2profile ]; then
db2 "list db directory" | grep -p Indirect | egrep -i -e "Database name" >> /tmp/DBNAME.list