If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > Informix > supressing output using dbaccess

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 10-28-08, 08:38
P_db_user P_db_user is offline
Registered User
 
Join Date: Jul 2008
Posts: 14
supressing output using dbaccess

Hi All,

I use dbaccess utility to connect to informix from shell scripts.

dbaccess $DB_NAME $SQL_FILE >$TMP_FILE 2>>$LOG_FILE

The log file contains messages like this
Database selected.


2 row(s) unloaded.


Database closed.


I want to supress these messages..

Thanks in advance for your help.

Rgds,
P_db_user
Reply With Quote
  #2 (permalink)  
Old 10-28-08, 14:20
parangiri parangiri is offline
Registered User
 
Join Date: Feb 2007
Location: Chennai, TN
Posts: 68
Hi,
Direct way of suppressing the "processing messages" does not seems to be available in unix shell script. Few steps needs to carried out for the purpose.

Step 1:
Create a file that contains the possible processing messages.
$ cat processmsg
Database Selected.
row(s) unloaded.
row unloaded.
Database Closed.
...
...
$ _

Step 2:
Execute your shell script
$ dbaccess $DB_NAME $SQL_FILE >$TMP_FILE 2>>$LOG_FILE

The actual result will be stored in $TMP_FILE.
The error message and the processing messages will be stored in the $LOG_file.

Step 3:
$ egrep -v processmsg $LOG_FILE > $LOG_FILE

Above step implies that the line with process messages are not displayed using -v option of egrep and is again redirected without append to the same file name $LOG_FILE which means that $LOG_FILE now holds only error messages.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On