From 41c872bf8af4cad1ff16f30c8ffbf36f65193774 Mon Sep 17 00:00:00 2001 From: rodri Date: Sat, 30 Jan 2021 09:49:00 +0000 Subject: make bmr a script and add new exercises. --- bmr | 35 ++++++++++++++++++++++++++++++++--- 1 file changed, 32 insertions(+), 3 deletions(-) mode change 100644 => 100755 bmr (limited to 'bmr') diff --git a/bmr b/bmr old mode 100644 new mode 100755 index 30ff882..e684312 --- a/bmr +++ b/bmr @@ -1,3 +1,32 @@ -# 66 + 6.23*lbs + 12.7*inch + 6.8*years -66 + 6.23*176.36 + 12.7*68.89 - 6.8*23 -1883.2258 +#!/bin/rc +# +# BMR following the Mifflin-St. Jeor equation +# P(kcal/day) = 10*weight(kg) + 6.25*height(cm) - (5*age(yr)) + s +# where s is +5 for men and -161 for women +# +s=5 +w=() +h=() +a=() +flagfmt='w' +args='weight height age' + +fn usage { + aux/usage + exit usage +} + +if(! ifs=() eval `{aux/getflags $*} || ~ $#* 0) + usage + +w=$1 +h=$2 +a=$3 + +if(~ $flagw 1) + s=-161 + +bc <