I am trying to set up a simple loop to periodically query a database table in bash. Usually it seems to me what to do:
sqsh -s SERV -U user -P passwd -D db -L bcp_colsep=','
then in sqsh i should enter:
select * from some_table where foo=bar
\go -m bcp > /path/to/output.out
I tried to use the parameter -Cfor sqsh to pass in the command as follows:
sqsh -s SERV -U user -P passwd -D db -L bcp_colsep=',' -C 'select * from some_table where foo=bar \go -m bcp > /path/to/output.out'
but I keep getting:
Incorrect syntax near '\'.
How can I get the desired effect?
source
share