namaycushs
Technical User
Hi,
I want to calculate the total allocated, free and used space for all filesystems which have dsk in their path.
I tried this:
df -k | awk ' /dsk/{
{ for (i=1; i<=NF; i++)
summe += $i/1024/1024
}
sum_zeile = "Summe:"
for (i=2; i<= 4; i++)
sum_zeile = sum_zeile "\t" summe
print sum_zeile}'
Where "Summe" means sum. As a result I get the accumulated sum for every line. How do I get the overall-total in one line i.e. above command | tail -1
I tried END {sum_zeile...} but this didn't work out. Why ?
I want to calculate the total allocated, free and used space for all filesystems which have dsk in their path.
I tried this:
df -k | awk ' /dsk/{
{ for (i=1; i<=NF; i++)
summe += $i/1024/1024
}
sum_zeile = "Summe:"
for (i=2; i<= 4; i++)
sum_zeile = sum_zeile "\t" summe
print sum_zeile}'
Where "Summe" means sum. As a result I get the accumulated sum for every line. How do I get the overall-total in one line i.e. above command | tail -1
I tried END {sum_zeile...} but this didn't work out. Why ?