View Single Post
Posts: 181 | Thanked: 82 times | Joined on Jan 2010
#11
Originally Posted by reinob View Post
Weird. Just as a test, change the command to

df -m $1 | tail -1 | awk ' { print $4 } '

with -m you get the megabytes directly. I suspect int() may be doing something weird.
No change. Still the same difference. $? is not geting the correct output value from the function for the /home free space when called from my test script. Indeed, the same happens if your try to get the space of /media/mmc1 (which in my case is 25745 MiB). The output number by echo $? is 145!!!

Edit: I have tested the same scripts in my computer's Ubuntu,and the output of the function is the same using echo $? than using echo $space (free space is 7418 MiB in my Ubuntu) . Maybe maemo is using a function output of byte type and numbers longer than 256 cannot be represented. However, Ubuntu works OK for long numbers. Any idea?

Last edited by ikerrg; 2012-11-08 at 13:51.
 

The Following 2 Users Say Thank You to ikerrg For This Useful Post: