Isql query in unix shell

Hi
i want write a script for list of sysbase are having access or open.

then i wrote like:

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

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

go
use blue (database name)
go
use red (database name)
go
use green(database name)
go
exit


then i can find some error messgae if some of database not found the server.

But i am not sure is this only way to find the database hasbeen running or not.

I hope we can use opendatabase command in sybase.. but i am not sure about this.please help me on this to write a single script for find the dabase are access or not.

---------- Post updated 02-26-10 at 09:54 AM ---------- Previous update was 02-25-10 at 02:31 PM ----------

Pls anyone tell me the Isql opendatabase issue