Dear Friends,
I wrote a script that get the size of specific files in a specific space directory. To get the total size I wrote a function in that script.
So far I am not convinced that function is working correctly.
Do you mind tell if there is anything wrong.
I am on SOLARIS (KSH)
The default size of the files are on Ko
#------------------------------------------------------
sum_taille () {
size_koctet=$1
if [ $size_koctet -gt 1073741824 ]
then
((size=$size_koctet /1024 /1024 /1024))
unite="Tera"
else
if [ $size_koctet -gt 1048576 ]
then
((size=$size_koctet /1024 /1024))
unite="Go"
else
if [ $size_koctet -gt 1024 ]
then
((size=$size_koctet /1024))
unite="Mo"
fi
fi
fi
echo "$size $unite"
}
#------------------------------------------------------
Thanks in advanced for your help