SLUG Mailing List Archives
Re: [SLUG] Shell math/BASH question
- To: DaZZa <dagibbs@xxxxxxxxx>
- Subject: Re: [SLUG] Shell math/BASH question
- From: Nick Andrew <nick@xxxxxxxxxxxxxxx>
- Date: Tue, 19 Oct 2010 16:55:37 +1100
- Cc: SLUG <slug@xxxxxxxxxxx>
- User-agent: Mutt/1.5.18 (2008-05-17)
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.