When i give the below command , it interacts with my database and give me the desired reults:-
isql -Usa -Pbas11 -Dsmdb
1>select distinct user_name from jobs
2>go
This fetch me the desired result. Here bas11 being the password and smdb being my database.
I want to do the same through Shell Script And redirect the O/P of this Sybase command to filesay /tmp/output.txt
The Shell Script i wrote is this :-
#!/bin/sh
isql -Usa -Psybase11 -Dcnadb << ./ritesh.txt > /tmp/output.txt
here ./ritesh txt which is input to sybase command contain :-
select distinct user_name from jobs go
But i am not geeting any output in /tmp/output.txt after executing this Shell Script .
I am new to Shell Script . Can anyone help me here ?
Thanks in Advance .
In sybase if you want the query output in a file then do as below:
Also, if its shell you can do something like this in shell,