Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Mailing Lists -> Oracle-L -> Re: awk question

Re: awk question

From: Darrell Landrum <darrell_at_landrum.com>
Date: Tue, 8 Jun 2004 22:55:04 -0500
Message-ID: <000f01c44dd5$8c746e70$6601a8c0@darrell1>


Here is an example of one idea, although there may be a cleaner way. I've used an ls -l command to get a particular file size instead of the orastat in your code, then compare that to a previously defined threshold. Basically, I take the threshold and the ls result and concat them into one variable with a space in between.
Then, send that value into your awk statement for the test of $1 to $2.

hp19:/home/dlandrum $ cat ak

export WARNING_THRESHHOLD=10

export TBS_WARNING=`ls -l test.ksh| awk '{print $5}'`

export CHK_TBS_WARNING="$TBS_WARNING $WARNING_THRESHHOLD"

echo $CHK_TBS_WARNING | awk '{if ($1 > $2) print $1}'

hp19:/home/dlandrum $ ksh -x ak
+ export WARNING_THRESHHOLD=10
+ awk {print $5}
+ ls -l test.ksh
+ export TBS_WARNING=21
+ export CHK_TBS_WARNING=21 10
+ echo 21 10
+ awk {if ($1 > $2) print $1}

21


Please see the official ORACLE-L FAQ: http://www.orafaq.com

To unsubscribe send email to: oracle-l-request_at_freelists.org put 'unsubscribe' in the subject line.
--
Archives are at http://www.freelists.org/archives/oracle-l/
FAQ is at http://www.freelists.org/help/fom-serve/cache/1.html
-----------------------------------------------------------------
Received on Tue Jun 08 2004 - 22:51:55 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US