I'm trying to capture the output of a sql query launched via script.
The script :
#!/bin/bash
sql articledb <<< "select toppapier from table \g \q"
The output:
INGRES TERMINAL MONITOR Copyright 2008 Ingres Corporation
Ingres Linux Version II 9.2.0 (int.lnx/143)NPTL login
Thu Aug 31 16:38:02 2017
continue
* Executing . . .
E_US0836 line 1, Column 'toppapier' not found in any specified table.
(Thu Aug 31 16:38:02 2017)
Ingres Version II 9.2.0 (int.lnx/143)NPTL logout
Thu Aug 31 16:38:02 2017
I want to redirect the output to a file and ONLY catch the error/result (here: E_US0836 line 1, Column 'toppapier' not found in any specified table.)
How may I achieve this?