Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google site




View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #10 (permalink)  
Old 12-01-2009
bigben1220 bigben1220 is offline
Registered User
 

Join Date: Nov 2009
Posts: 34
Im sorry if Ive confused you...

Objective:
1. Calculate the sum of total space, used space for all matching 'filesystems'
2. Display "Total Space = xx " ; "Used Space = yy"; "Free space = zz"

This is the script I have wrote for it:
[code1]
find / -name 'filesystem' 2>/dev/null
while read line
do
bdf $line
done


awk '{print$1}' | sort -n | grep -v used | awk '{sum += $1} END { print sum;}'

The find command works fine, but the while do command hangs? So I dont know if the awk print line works?

Bigben