As part of my bash shell script I am running the following code:
sql -umyuser mydb <<-EOSQL
MODIFY $MYTABLECLEAR TO TRUNCATED;\g
EOSQL
This works perfectly, but I get output in the terminal window, that I would like to avoid. Normally I would simply add a >/dev/null statement to the end of a command that I wanted to suppress output on, however I can't do this without screwing up the EOSQL text block.
I have tried putting the following:
`sql -umyuser mydb <<-EOSQL
MODIFY $MYTABLECLEAR TO TRUNCATED;\g
EOSQL` >/dev/null
But here I get a message in the terminal window saying TERMINAL: command not found.
Interestingly the sql command still runs despite this message.
Any help would be much appreciated.
Thanks,
Paul.
(sql ... ) &> /dev/nullsqlas a shell command. Whatever or whoever convinced you to use that particular syntax should probably be abandoned as a source for shell scripting advice.