The UNIX and Linux Forums  


Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
grep unix.com with google



Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

Reply
English Japanese Spanish French German Portuguese Italian Powered by Powered by Google
 
Thread Tools Search this Thread Rate Thread Display Modes
  #8 (permalink)  
Old 11-30-2009
Registered User
 

Join Date: Nov 2009
Posts: 19
Would it know to bdf certain files?


Code:
 

find / -name filename 2>/dev/null
while read line
do
        bdf $line
done
 awk '{print$1}' | sort -n | grep -v used | awk '{sum += $1} END { print sum;}'


Last edited by pludi; 12-01-2009 at 02:01 AM..
  #9 (permalink)  
Old 11-30-2009
Registered User
 

Join Date: Sep 2006
Posts: 2,604
seriously, i have problem understanding your problem
  #10 (permalink)  
Old 12-01-2009
Registered User
 

Join Date: Nov 2009
Posts: 19
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
  #11 (permalink)  
Old 12-01-2009
Registered User
 

Join Date: Nov 2009
Posts: 39
EDIT: woops didn't see there was page2
Sponsored Links
Reply

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off




All times are GMT -4. The time now is 07:48 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0