# Shell scripting

**URL:** <https://community.unix.com/t/shell-scripting/309824>\
**Category:** Shell Programming and Scripting\
**Created:** [May 8, 2012, 8:58am UTC](https://community.unix.com/t/shell-scripting/309824 "2012-05-08T08:58:23Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Phuti](https://community.unix.com/letter_avatar/phuti/32/6_22734026db12803ebb3e059622ac3534.png) [@Phuti](https://community.unix.com/u/Phuti)\
**Post date:** [May 8, 2012, 8:58am UTC](https://community.unix.com/t/shell-scripting/309824/1 "2012-05-08T08:58:23Z")

</div>

Hi Guys,

I am using RHEL5 and my filesystem are on NetApp.

I am busy with the script that would alert me when the filesystem is above 90%.

Now I have this code that I found on the net:

```nohighlight
df -h | awk '$4 >= "90%" {print $0}' | awk '{print $6"\t\t\t"$5}'

```

But my filesystem are like these:

```nohighlight
>df -h

volumename:/vol/fas1_hostname_db/db_data2
                      100G 88G 13G 88% /u119
volumename:/vol/fas1__hostname_db/db_data3
                      100G 81G 20G 81% /u120
volumename:/vol/fas1_hostname_db/db_data4
                      100G 82G 19G 82% /u121
volumename:/vol/fas2_hostname_db/db_data5
                      250G 228G 23G 91% /u128

```

This command gives me this:

```nohighlight
Linux:oracle:/home/db/scripts>df -h | awk '$4 >= "90%" {print $0}' | awk '{print $6"\t\t\t"$5}'
Mounted Use%
                             /u128

```

But I want something like these:

```nohighlight
Mounted Use%
/u128 91%

```

How do I do that?

Please Help!!!!!!!!!

Thanks in advance...

---

<div class="post-metadata">

**Author:** ![bartus11](https://community.unix.com/user_avatar/community.unix.com/bartus11/32/1418_2.png) [@bartus11](https://community.unix.com/u/bartus11)\
**Post date:** [May 8, 2012, 9:03am UTC](https://community.unix.com/t/shell-scripting/309824/2 "2012-05-08T09:03:29Z")

</div>

```nohighlight
df -hP | awk '$5 >= "90" {print $6"\t\t"$5}'

```

---

<div class="post-metadata">

**Author:** ![pamu](https://community.unix.com/letter_avatar/pamu/32/6_22734026db12803ebb3e059622ac3534.png) [@pamu](https://community.unix.com/u/pamu)\
**Post date:** [May 8, 2012, 9:05am UTC](https://community.unix.com/t/shell-scripting/309824/3 "2012-05-08T09:05:15Z")

</div>

```nohighlight
df -h | sed 's/ //g' | awk -F "[G%]" '{ if ( $4 > 90) print;}'

```

---

<div class="post-metadata">

**Author:** ![Phuti](https://community.unix.com/letter_avatar/phuti/32/6_22734026db12803ebb3e059622ac3534.png) [@Phuti](https://community.unix.com/u/Phuti)\
**Post date:** [May 14, 2012, 3:38am UTC](https://community.unix.com/t/shell-scripting/309824/4 "2012-05-14T03:38:57Z")

</div>

Thanks a lot guys...
