The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

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



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

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
help me in sending parameters from sqlplus script to unix shell script Hara Shell Programming and Scripting 2 01-29-2008 03:31 PM
Shell Script: want to insert values in database when update script runs ring Shell Programming and Scripting 1 10-25-2007 03:06 AM
here document to automate perl script that call script hogger84 Shell Programming and Scripting 3 10-22-2007 10:15 AM
returning to the parent shell after invoking a script within a script gurukottur Shell Programming and Scripting 5 09-26-2006 07:05 AM
return valuse from child script to parent script borncrazy Shell Programming and Scripting 1 08-20-2004 03:39 PM

 
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #1 (permalink)  
Old 04-07-2008
oduth oduth is offline
Registered User
  
 

Join Date: Apr 2008
Posts: 7
Awk script

Hi all,

I can't see some of file systems capacity output with file system name using below script:

here is the df output:
Code:
Filesystem           1K-blocks      Used Available Use% Mounted on
/dev/sda3             15116868  11890900   2458064  83% /
/dev/sda1               101086     13517     82350  15% /boot
none                  32435708         0  32435708   0% /dev/shm
/dev/mapper/ffderora-gghlvora
                      28092588   5301140  21364404  20% /oracle
/dev/sdi1            114222112 107657120   6564992  95% /orad2
/dev/sdh1            228444256 215828000  12616256  95% /orad9
/dev/sdj1            228444256 215594592  12849664  95% /orad10
/dev/sdk1            228444256 215086688  13357568  95% /orad11
/dev/sdl1            228444256 172073280  56370976  76% /orad12
/dev/sdm1            228444256 209843648  18600608  92% /orad1
/dev/mapper/ffderora-gghlvora
                     280995708 195028872  71696128  74% /rads01
Here is my script:
Code:
df -k | grep -v /dev/shm | grep -v cdrom | awk '{print $6,$5}' | tr -d \%
and its output:

Code:
/ 85
/boot 15

/oracle
/orad2 95
/orad9 95
/orad10 95
/orad11 95
/orad12 90
/orad1 92

/rads01
As you can see above output, /oracle and /rads01 file-systems have no capacity output since they have one more line (double-line)

how can i fix it?

Regards,

Last edited by Yogesh Sawant; 04-07-2008 at 04:00 AM.. Reason: added code tags
 

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 On




All times are GMT -4. The time now is 01:58 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