Re: Pesky informational messages in dbaccess
Posted in 1997
jake@apparel.net (Jacob Salomon ) wrote:
> in my shell script, I have a sequence of code like:
>
> dbaccess mydatabase - | grep-cmd <<%%
> select blah blah...
> ... (more blah)
> %%
>
> This works, basically. However....
> All I want to see the the seelcted data.
>
> I do NOT want the column headings; hence, the grep command in the above
> example(adequate for simple purposes).
>
> I do NOT want the messages like "42 rows selected" and "database
> selected", which go to stderr.
To avoid (at least) the column headers, use
(
dbaccess mydatabase - <<%%
output to pipe "cat" without headings
select blah blah...
... (more blah)
%%
) | grep-cmd
The "42 row(s) retrieved" and error msgs both go to stderr, so you still
need a grep -v command to skip the "retrieved" lines. (I like the
parentheses around the here-document 'cause it lets you put the commands
that follow the here-doc after it; nice if there are a few more commands.)
--
_____________________________________________________________________
| Colin McGrath cmm@trac3000.ueci.com |
| Raytheon Engineers & Constructors, Inc. (215) 422-4144 |
| Phila, PA, USA Standard Disclaimers Apply |
|___________________________________________________________________|