Tugger the SLUGger!SLUG Mailing List Archives

Re: [SLUG] Shell math/BASH question

On Tue, Oct 19, 2010 at 09:00:16AM +1100, DaZZa wrote:
> The results from the third party software query are assigned as
> variables in the script and converted into round numbers as below
> free='/<external process>'
> total='<external process>'

Course they're not numbers if they look like '2.47T' or '25.40G'.

Do "df -k -P -T" and grab the size & available as 3rd and 5th
values on each output line; they're integers and high enough
resolution for most purposes.