[Rule-list] finding hard disk size

hairylarry at deltaboogie.com hairylarry at deltaboogie.com
Tue Apr 9 04:17:12 EEST 2002


Hi,

Here's a script we can check. It works for me.

-----

#!/bin/sh

factor1=$(fdisk -l | grep Disk | cut -d , -f 3 | cut -d c -f 1 )
factor2=$(fdisk -l | grep Units | cut -b 22- | cut -d '*' -f 1 )
factor3=$(fdisk -l | grep Units | cut -b 22- | cut -d '*' -f 2 | cut -d b -f 1 )

sizeinbytes=$(( factor1 * factor2 * factor3 ))

echo $factor1
echo $factor2
echo $factor3
echo $sizeinbytes

-----

Thanks,

Hairy Larry

_______________________________________________
Rule Project HOME PAGE:  http://www.freesoftware.fsf.org/rule/
Original Rule Development Site http://savannah.gnu.org/projects/rule/Rule-list at mail.freesoftware.fsf.org
http://mail.freesoftware.fsf.org/mailman/listinfo/rule-list



This full static mirror of the Run Up to Date Linux Everywhere Project mailing list, originally hosted at http://lists.hellug.gr/mailman/listinfo/rule-list, is kept online by Free Software popularizer, researcher and trainer Marco Fioretti. To know how you can support this archive, and Marco's work in general, please click here