> On Tue, May 8, 2012 at 2:14 AM, Mike Miller <mbmiller+l at gmail.com> wrote: [SNIP] > ---------------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--------------- I'd get rid of the epensive bash call. :-) #! /usr/bin/awk -f BEGIN {printf("%.1f kg/m²\n", 703.06958*ARGV[2]/ARGV[1]^2)} -- Gerry Skerbitz gsker at skerbitz.org -------------- next part -------------- _______________________________________________ TCLUG Mailing List - Minneapolis/St. Paul, Minnesota tclug-list at mn-linux.org http://mailman.mn-linux.org/mailman/listinfo/tclug-list