Hi,
I am new to Sybase database.
I need write a UNIX shell script for is the giving database has open or not? Some times the number of databases is more than 20.

I wrote UNIX script like:

USER="xyz"
PASS="abc"
SERVER="SCCS"
DB="blue"
WORK_DIR="/usr/home/genesys/Sayantan/ramakrishna"

set -x
isql -U${USER} -P${PASS} -S${SERVER}<<EOF>$WORK_DIR/output.log

go
use db1
go
use db2
go
use db3

EOF.

I am not sure this's correct way to write the script. So could you please advise in script how ca we find the database has accessible or not.