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
why the below script is not working ., konankir Shell Programming and Scripting 14 03-27-2008 04:32 PM
Pls. Help my script not working as it should cocoabeauty1 Shell Programming and Scripting 1 07-28-2007 05:11 PM
FTP script not working rookie250 Shell Programming and Scripting 2 12-19-2006 02:49 AM
Script not working as desired mhssatya Shell Programming and Scripting 39 08-23-2006 09:51 AM
Backspace Not Working in Script Atama Shell Programming and Scripting 4 04-26-2002 10:17 AM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 11-16-2007
kpatel786 kpatel786 is offline
Registered User
  
 

Join Date: Apr 2007
Posts: 12
bdf script not working !!

Hi,
I have written a funtion which taken bdf output and put's in a file.
The idea is to grep a areas which greater then 80% and echo the same on the system. However the script I have written fails with the error :-

+ awk $0 !~ /^F/
+ awk {print $5"\t" $6}
+ sed s/%//
+ 1> /tmp/bdflist}
./test[8]: Syntax error at line 9 : `do' is not expected.

The script is :-

output ()
{/usr/bin/bdf -l |awk '$0 !~ /^F/' |awk '{print $5"\t" $6}'| sed 's/'%'/''/' >/tmp/bdflist}

panic ()
{while read percent dir
do
if [[ $percent -ge 80 ]]
then
echo "File syste Full - `hostname`:$dir is at $percent%"
fi
done} < /tmp/bdflist
output
panic

Please assist in resolving the same.
Thanking you in advance.
  #2 (permalink)  
Old 11-16-2007
manzier manzier is offline
Registered User
  
 

Join Date: Oct 2007
Posts: 9
Try This

done < /tmp/bdflist
}
  #3 (permalink)  
Old 11-16-2007
kpatel786 kpatel786 is offline
Registered User
  
 

Join Date: Apr 2007
Posts: 12
Still giving the same error. Thanks
  #4 (permalink)  
Old 11-16-2007
manzier manzier is offline
Registered User
  
 

Join Date: Oct 2007
Posts: 9
Unmatched double quote

sed 's/'%'/''/'

sed 's/'%'//'
Sponsored Links
Closed Thread

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 09:31 PM.


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