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.