How to display partition name on mounted on using this script

Hi All Guys....

root> df -k|grep /u0

/dev/vx/dsk/oradg/u02vol 12582912 8717924 3744252 70% /u02
/dev/vx/dsk/oradg/u01vol 8796160 5563610 3131556 64% /u01
/dev/vx/dsk/oradg/u04vol 10035200 1247888 8519534 13% /u04
/dev/vx/dsk/oradg/u03vol 12582912 2524060 9744542 21% /u03

root> df -k|grep /u0|awk '{ print $4 }'

3744252
3132546
8519534
9744542
----------------------------------------------------
check_oracle_filesystem.ksh
----------------------------------------------------
#!/bin/ksh

for i in `df -k|grep /u0|awk '{ print $4 }'`
do
# Convert the file size to a numeric value
filesize=`expr i`

# If any filesystem has less than 4000000k, issue an alert
if [ $filesize -lt 4000000 ]
then
echo "Call Fauzi" | mailx -r oraadm@juwpkl.gov.my -s "Oracle filesystem $i has less than 4000000k free"\
adzuan@nc.com.my
fi
done
--------------------------------------------------------------------------------------------------------------
Based on that script, it will display at subject header of the email with " Oracle 3744252 3132546 has less than 4000000k free

My question is, how to display the Partition Name (mounted on) to be display at subject header???

:o

i dont't know whether this will help..but i hope so

df -k|grep /u0 > file--->redirect to a temp file

In the main script
val=$(cat tempfile | wc -l ) --> counting the no of lines

execute the loop that many times only

Inside the loop ..read one line from the file

cat tempfile | while read LINE
#LINE --> each line from the file
val1= echo LINE | awk { print $4 }--->get the size
val2 =echo line | cut -d ' ' -f1 ----> this will store the partition name

now you can continue with the if test if a partcular value matches your condition then use the corresponding partition info already stored for mssging

.....hopefully this will work if not ......sorry in advance

Hi Mobydisck
TQ for the suggestion
I'm not very good instead very poor in knowledge about this script
Kindly can u advise me step by step on how to integrate your suggestion into my original script previously...

When u ask me to do "if" test, i'm really out of idea on how to start running the test with your suggestion:o.

Try this:

df -k | awk '$6 ~ /\/u0/ && $4 < 4000000/ { system("echo Call Fauzi | mailx -r oraadm@juwpkl.gov.my -s \"Oracle filesystem " $6 " has less than 4000000k free\" adzuan@nc.com.my") }'