I am trying to show the results of df -k on HP for 1 to n filesystems on one line for each filesystem.
df -k results are as follows
/opt/app (/dev/vg1001/lv100102 ) : 14703148 total allocated Kb
3393810 free allocated Kb
11309338 used allocated Kb
76 % allocation used
I want to do a df -k for all of a type of file systems "/dba/appl01" --- /dba/applxx" and have the results like the following
/dba/appl01 123456 123456 123456
....
/dba/applxx 123456 123456 123456
Here is what I am try to use but I think my problem is getting the info into an array and then knowing how to get out the filesystem and other space numbers correctly.
This is being run from a ksh script to report space info.
ListEachFs()
{
set -vx
ls -ld /dba/*|grep -i oracle|awk '{print $9}'|sort|while read FileSys;do
df -k $FileSys|grep -i "allocated Kb"|awk '{ for ( x = 1; x <= NR; x++ ) arr[x] = $0} END{ for (d in arr) if ($d ~ /allocated/ ) print $d, arr[d]}'
done
}
I use the "ls -ld /dba/*|grep -i oracle|awk '{print $9}'" to only get mounted fs's in a cluster system.
When I run the above all I get is the "used allocated Kb" line for all filesystems.
I have searched forums, books, web etc.. and I still can not get the right syntax combinations.
Lots of help showing functions etc.. is beyond me still. Any help will be greatly appreciated.
df -k results are as follows
/opt/app (/dev/vg1001/lv100102 ) : 14703148 total allocated Kb
3393810 free allocated Kb
11309338 used allocated Kb
76 % allocation used
I want to do a df -k for all of a type of file systems "/dba/appl01" --- /dba/applxx" and have the results like the following
/dba/appl01 123456 123456 123456
....
/dba/applxx 123456 123456 123456
Here is what I am try to use but I think my problem is getting the info into an array and then knowing how to get out the filesystem and other space numbers correctly.
This is being run from a ksh script to report space info.
ListEachFs()
{
set -vx
ls -ld /dba/*|grep -i oracle|awk '{print $9}'|sort|while read FileSys;do
df -k $FileSys|grep -i "allocated Kb"|awk '{ for ( x = 1; x <= NR; x++ ) arr[x] = $0} END{ for (d in arr) if ($d ~ /allocated/ ) print $d, arr[d]}'
done
}
I use the "ls -ld /dba/*|grep -i oracle|awk '{print $9}'" to only get mounted fs's in a cluster system.
When I run the above all I get is the "used allocated Kb" line for all filesystems.
I have searched forums, books, web etc.. and I still can not get the right syntax combinations.
Lots of help showing functions etc.. is beyond me still. Any help will be greatly appreciated.