Query result from shell script

Hi,

I wrote the below script to get the query result from a Syabase DB.

isql -s -U **** -P **** SYBASE SERVERNAME
USE ***(Database name in Sybase)
@command.sql

But im not getting the output. Can anyone help me on this

See if something like this works:

isql -s -U **** -P **** SYBASE SERVERNAME << EOF
USE ***(Database name in Sybase)
@command.sql
EOF

Of course, you should consider that whilst the query is running, the user and password will be there for all to see with a simple ps command. Can you embed them in the code like this:-

isql -s SYBASE SERVERNAME << EOF
userid/password
USE ***(Database name in Sybase)
@command.sql
EOF

I'm not clear on the exact syntax, but it's to mimic how you would connect for an interactive session from the command line.

I hope that this helps,
Robin