26 lines
452 B
Bash
26 lines
452 B
Bash
#!/bin/bash
|
|
|
|
declare -f magassag
|
|
declare -i tomeg
|
|
|
|
read -p "Add meg a magasságod (cm): " magassag
|
|
|
|
magassag=$(echo "sclae=2; $magassag / 100" | bc -l)
|
|
|
|
read -p "Add meg a testtömeged (kg): " tomeg
|
|
|
|
declare -f BMI
|
|
|
|
|
|
BMI=$(echo "scale=2; $tomeg / ($magassag * $magassag)" | bc -l)
|
|
|
|
echo $BMI
|
|
|
|
if (( $(echo "$BMI < 18.5" | bc -l) )); then
|
|
echo "Sovány"
|
|
elif (( $(echo "$BMI < 24.9" | bc -l) )); then
|
|
echo "Normál"
|
|
else
|
|
echo "Túlsúly"
|
|
fi
|