Ok here is the problem
declare -i number=10
echo $number # number=10
echo $number #number =11
echo $number #number =10
echo $number #number=10 <------ THIS IS THE PROBLEM IT SHOULD BE 11 AFTER THE FUNCTION ADDS ONE TO IT
My actual situation is a little more complicates as I am piping standard input from sort into the function.
I don't really want to pass parameter to the functions - actually I tried that and I had a little trouble with it