Hi Guys
Here is the final script...
i was unable to convert the KBs to GBs in a single line as discussed in above replies..
so i dealt it with below code
Code:
#!/bin/sh
df |awk '{ print $4 "\t" $6 }'|grep -v -e shm -e boot > sp.txt
cat sp.txt | grep -v -e Avail -e oracle_home > sp1.txt
sed '1d' sp1.txt > sp2.txt
while read inputline
do
echo $inputline > test.txt
input=`cat test.txt |awk '{print $1}'`
if [[ $input -lt 52428800 ]]
then
conv1=`cat test.txt | awk '{print $1}'`
((mega=$conv1/1024))
((giga=$mega/1024))
echo "Mount point `cat test.txt|awk '{print $2}'` has "$giga" GB"
else
conv2=`cat test.txt | awk '{print $1}'`
((mega=$conv2/1024))
((giga=$mega/1024))
echo "inside else"
echo "Mount point `cat test.txt|awk '{print $2}'` has "$giga" GB"
fi
done < sp2.txt
Any help to shorten above code will be greatly appreciated.
Regards