Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Mailing Lists -> Oracle-L -> Re: awk question
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
-- 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
![]() |
![]() |