Results 1 to 2 of 2
  1. #1
    Join Date
    Jul 2008
    Posts
    14

    Unanswered: 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

  2. #2
    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.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •