I am writing script that returns the size of each disk or partition when called. I am using FDISK -l and parsing the results to get the result I want. When I execute fdisk -l it shows correct results, BUT when I execute the same thing with results to be put in a variable, I get strange results:
When I want the output to be put in $result variable, fdisk -l returns the files in the folder as well. Another example: When I execute from /:
Can anybody tell me why this thing happens? I'm running mandriva 2008.1 by the way.