Re: awk question

  • From: "Darrell Landrum" <darrell@xxxxxxxxxxx>
  • To: <oracle-l@xxxxxxxxxxxxx>
  • Date: Tue, 8 Jun 2004 22:55:04 -0500

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



----- Original Message ----- 
From: "David Green" <thump@xxxxxxxxxxxxxxxx>
To: <oracle-l@xxxxxxxxxxxxx>
Sent: Tuesday, June 08, 2004 6:11 PM
Subject: awk question


----------------------------------------------------------------
Please see the official ORACLE-L FAQ: http://www.orafaq.com
----------------------------------------------------------------
To unsubscribe send email to:  oracle-l-request@xxxxxxxxxxxxx
put 'unsubscribe' in the subject line.
--
Archives are at //www.freelists.org/archives/oracle-l/
FAQ is at //www.freelists.org/help/fom-serve/cache/1.html
-----------------------------------------------------------------

Other related posts: