5. What's your BMI?  Use my script. (Mike Miller)
>    6. Re: What's your BMI? Use my script. (Jake Vath)
>
>

> Message: 5
> Date: Tue, 8 May 2012 02:14:34 -0500 (CDT)
> From: Mike Miller <mbmiller+l at gmail.com>
> To: TCLUG List <tclug-list at mn-linux.org>
> Subject: [tclug-list] What's your BMI?  Use my script.
> Message-ID: <alpine.DEB.2.00.1205080154560.22297 at taxa.psych.umn.edu>
> Content-Type: text/plain; charset="utf-8"; Format="flowed"
>
> See my one-liner below, with documentation.
>
> Body Mass Index, or BMI, is weight/height?, but weight is in kilograms and
> height is in meters, so the units are kg/m?.  We usually measure height in
> feet and inches and weight in pounds, so I wrote this little script for
> computing BMI from height in inches and weight in pounds.  I call the
> script "bmi".  Supposedly, if your BMI exceeds 30, you are obese and if it
> exceeds 25, you are overweight.  A lot of us sit around too much, so we
> are prone to gain weight and to get type-2 diabetes.  Good diet and
> exercise are critical for prevention.
>
> I just thought you might like the little piece of awk code.  I'm too lazy
> to write out the if/else statements to get it to tell you if you are
> underweight, normal, overweight or obese, or to tell you how many pounds
> you should lose.  I might add that someday.  (I'm about 9 lbs overweight.)
>
> Inevitably someone will point out that it doesn't distinguish fat mass
> from muscle mass, which is true.  If you are unusually muscular, or the
> opposite, you'll want to take that into account.  It turns out to
> correlate very well with harder-to-obtain measures of body fat.
>
> Mike
>
>
> ---------------begin script on next line----------------
> #!/bin/bash
>
> # Computes your Body Mass Index (BMI) from height
> # in inches and weight in pounds
> #
> # Syntax:
> #
> # bmi num1 num2
> #
> # where num1 is height in inches and
> #       num2 is weight in pounds
> #
> # http://www.nhlbisupport.com/bmi/
> #
> # Underweight = <18.5
> # Normal weight = 18.5?24.9
> # Overweight = 25?29.9
> # Obese = > 30
>
>
> echo $1 $2 | awk '{printf("%.1f kg/m?", 703.06958*$2/$1^2)}'
> --------------end script on previous line---------------
>
> ------------------------------
>
> Message: 6
> Date: Tue, 8 May 2012 07:47:30 -0500
> From: Jake Vath <jake.vath at gmail.com>
> To: TCLUG Mailing List <tclug-list at mn-linux.org>
> Subject: Re: [tclug-list] What's your BMI? Use my script.
> Message-ID:
> 	<CAMeWMmipmBQ8zU19uuV_aeu1GihSfm_s3sJbkgDMgCOxQL7www at mail.gmail.com>
> Content-Type: text/plain; charset="windows-1252"
>
> I don't know why, but I find this idea to be unusually cool...
> A Bash script for computing my BMI? I never thought of using Bash to
> implement a solution like this, it's fun.
>
>  I'm too lazy to write out the if/else statements to get it to tell you if
>> you are underweight, normal, overweight or obese, or to tell you how
>> many
>> pounds you should lose.
>
> If I have time this week, I might do that. I'll send it back out to the
> list if I do.
>
> Thanks!
>
> -> Jake
>
> On Tue, May 8, 2012 at 2:14 AM, Mike Miller <mbmiller+l at gmail.com> wrote:
>
>> See my one-liner below, with documentation.
>>
>> Body Mass Index, or BMI, is weight/height?, but weight is in kilograms
>> and
>> height is in meters, so the units are kg/m?.  We usually measure height
>> in
>> feet and inches and weight in pounds, so I wrote this little script for
>> computing BMI from height in inches and weight in pounds.  I call the
>> script "bmi".  Supposedly, if your BMI exceeds 30, you are obese and if
>> it
>> exceeds 25, you are overweight.  A lot of us sit around too much, so we
>> are
>> prone to gain weight and to get type-2 diabetes.  Good diet and exercise
>> are critical for prevention.
>>
>> I just thought you might like the little piece of awk code.  I'm too
>> lazy
>> to write out the if/else statements to get it to tell you if you are
>> underweight, normal, overweight or obese, or to tell you how many pounds
>> you should lose.  I might add that someday.  (I'm about 9 lbs
>> overweight.)
>>
>> Inevitably someone will point out that it doesn't distinguish fat mass
>> from muscle mass, which is true.  If you are unusually muscular, or the
>> opposite, you'll want to take that into account.  It turns out to
>> correlate
>> very well with harder-to-obtain measures of body fat.
>>
>> Mike
>>
>>
>> ---------------begin script on next line----------------
>> #!/bin/bash
>>
>> # Computes your Body Mass Index (BMI) from height
>> # in inches and weight in pounds
>> #
>> # Syntax:
>> #
>> # bmi num1 num2
>> # # where num1 is height in inches and
>> #       num2 is weight in pounds
>> #
>> # http://www.nhlbisupport.com/**bmi/ <http://www.nhlbisupport.com/bmi/>
>> #
>> # Underweight = <18.5
>> # Normal weight = 18.5?24.9
>> # Overweight = 25?29.9
>> # Obese = > 30
>>
>>
>> echo $1 $2 | awk '{printf("%.1f kg/m?", 703.06958*$2/$1^2)}'
>> --------------end script on previous line---------------
>> _______________________________________________
>> TCLUG Mailing List - Minneapolis/St. Paul, Minnesota
>> tclug-list at mn-linux.org
>> http://mailman.mn-linux.org/mailman/listinfo/tclug-list
>>
>>
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL:
> <http://mailman.mn-linux.org/pipermail/tclug-list/attachments/20120508/740277dd/attachment.html>
>
> ------------------------------
>
> _______________________________________________
> TCLUG Mailing List - Minneapolis/St. Paul, Minnesota
> tclug-list at mn-linux.org
> http://mailman.mn-linux.org/mailman/listinfo/tclug-list
>
> End of tclug-list Digest, Vol 89, Issue 12
> ******************************************
>

my bash script for bmi

 #!/bin/bash
#Ron bash scripting noob.
sev=703
echo "Enter your height in inches then press enter"
read height
echo "enter your weight in pounds then press enter"
read weight
h2=$[$height * $height]
plh=`echo " scale=30; $weight / $h2 " | bc`
bmi=`echo "scale=30; $plh * $sev " | bc`
echo "If your Body mass is between 18.5 and 24.9 you are healthy."
echo "If your body mass id less then 18.5 your too skinny."
echo "If your body mass is more then 30 you are dangerously over weight."
echo " your body mass is $bmi"



I was wondering if awk and sed get rid of the need to use the bc for
floating point numbers ?

,Ron