schintapalli
Programmer
In Informix, I want to execute some sql scripts from a Unix (Sun Solaris)shell program. The requirement is such that one sql should be executed on database1@server1 and another sql on database2@server2.
After executing these scripts I want to capture the output (both errors as well as any result set) to a file. PLease let me know how to handle this from a single shell program.
I was trying out with a simple shell script, like
dbaccess db1@srvr1 < p.sql 1>&2 2> source.log >>source.log
dbaccess db2@srvr2 <p.sql 1>&2 2>> source.log >> source.log
But I am not able to capture the out put fully. I am missing some info in the out put file. When I execute these individual commands from Unix prompt like
dbaccess db1@srvr1 < p.sql 1>&2 2> source.log >>source.log
I am able to capture the output including all error message. Please let me know how to handle this.
After executing these scripts I want to capture the output (both errors as well as any result set) to a file. PLease let me know how to handle this from a single shell program.
I was trying out with a simple shell script, like
dbaccess db1@srvr1 < p.sql 1>&2 2> source.log >>source.log
dbaccess db2@srvr2 <p.sql 1>&2 2>> source.log >> source.log
But I am not able to capture the out put fully. I am missing some info in the out put file. When I execute these individual commands from Unix prompt like
dbaccess db1@srvr1 < p.sql 1>&2 2> source.log >>source.log
I am able to capture the output including all error message. Please let me know how to handle this.