#!/bin/bash # Encoding: UTF-8 (Unicode) # :set syntax=sh #=========================================================================== # Copyright ©MMXX - J. S. Gilstrap - JSG™ # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; version 3 of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . # # Any knowledge gained by viewing and/or using this software may NOT be used # to file for any 'submarine' patents on applicable algorithmns and/or ideas # or any other method that would undermine the free use and/or distribution # thereof. By viewing and/or using this software you agree to these terms. # If you cannot agree to this then do NOT view and/or use this software. #=========================================================================== # Shoe Size Calculator # Display help. if [ "$1" = --help ] then echo echo " Shoe Size Calculator" echo " Usage: shoe-size-calculator [-e text editor ] [ output filename ]" echo exit 1 fi # Text Editor: vi, vim, gvim, pico, nano, gedit, kedit, kate, oowriter ... Ed=vi # ANSI Color Formatting Mx="Mex" ; UK="UK" ; US="US" usM="usM" ; usW="usW" BR=" BR " ; ITEU="IT|EU" ; FR="F R" # Uncomment for no color. #Mx="Mex" ; UK="UK" ; usM="usM" ; usW="usW" ; BR=" BR " ; ITEU="IT|EU" ; FR="FR " # Width & Girth calculations are tuned to data obtained from DOROTHY Mass Foot Measurement Campaign of Europe in 2010. # Ⅰ Ⅱ Ⅲ Ⅳ Ⅴ Ⅵ Ⅶ Ⅷ Ⅸ Ⅹ Ⅺ <-[Alt.] # A B C D E F G H I ┊ j k <-[UK Width] # AAA AA A B C D E EE EEE 4E 5E <-[US Width] A="33 " ; B="34 " ; C="35 " ; D="36 " ; E="37 " ; F="38⅛" ; G="39¼" ; H="40⅜" ; I="41½" ; J="42¾" ; K="44 " # Width Spacing Factor: ×1.029186=¹⁰√1⅓ wA=3300 ; wB=3396 ; wC=3495 ; wD=3597 ; wE=3702 ; wF=3811 ; wG=3922 ; wH=4036 ; wI=4154 ; wJ=4275 ; wK=4400 # # Ⅲ Ⅴ Ⅶ # N M W # Narrow Meduim Wide N="35 " ; M="37 " ; W="39¼" wN=3495 ; wM=3702 ; wW=3922 # Under the Brannock width system the narrowest width in this range corresponds # to a womens 11B and the widest to a mens 12EEE. While this does not cover the # narrowest of womens widths in the Brannock system it does cover the vast majority # of the narrow widths contained in the Dorothy data. The AAA width percentage for # women in the Brannock system can vary from ~26% for a size 3 to ~29% for a size # 12. This 3% variance for the AAA width is unexceptable but is the inherent # shortcomings of the Brannock width system and there are few if any data points # in the Dorothy data below 33½%. To a lesser extent this is also true for the # mens EEE width with a 2% variation for sizes 4 to 15. The Brannock width system # with its consistent 37½% for the D width across the whole size range is an # improvement over the original system which produced even more radical curves # where 1/12" increment is used to increment the width per ½ size and also widths # between the same size; hence going up by ½ size will also increase the width by # 1 increment. In the Brannock system width is incremented by 1/16" per ½ size # (⅙") and there is a 3/16" spacing betheen widths. So 6/16 = 37½% and this is # what makes the D width percentage consistent across the whole size range. Going # up or down by ½ size will increment the width by ±⅓ or going up/down in width # with a ∓½ size increment respectivey will increment the width by ⅔. In practice # for the most part the Brannock width system works pretty well and widths C & E, # and to a lesser extent B, on either side of D have minor curve deviations but # still produce favorable results. For those widths further away from D the curves # are more radical and the results are less desireable. In this system presented # here width spacing is a consistent fractional increment of the percentages and # efficiently contains almost all Dorothy data points within its boundries. These # width percentages used here may not correspond to the conventional labeling # associated with them so an alternative could be to use Roman numerals. # Specify editor on command line. [ "$1" = -e ] && { Ed="$2" ; shift 2 ; } # Display message. cat < : " read fname [ -n "$fname" ] && OutFile="$fname" || OutFile="$1" [ -n "$OutFile" ] && break printf " Enter Filename <> : " sleep 1 done # Open file handle for temporary file. TMP=/tmp/shoe-size-calculator_$$ if exec 3> $TMP then printf "\n$TMP temporary file created.\n\n" else printf "\nTemp file Can NOT be created. Quitting!\n" sleep 1 exit 1 fi # Column data processor Parse() { local cnt=-1 value label # Gather values for value in $VALUES do let cnt++ label=${COLUMNS[$cnt]} case "$label" in UK:) width="$value" ;; mm:) length="$value" ;; in.) in="$value" ;; Last.mm) last="$value" ;; esac done cnt=-1 echo >&3 # Print values for value in $VALUES do let cnt++ label=${COLUMNS[$cnt]} [ -z "$label" ] && break printf "% 15b" "${label/_/ }" >&3 case "$label" in 'IT|EU:') case "$System" in Barleycorn) value="$value = 1¼ × [ ${length}mm ÷ 8 + ¾ ] (Foot Length)" ;; 'MondoPoint 5mm') value="$value = 0.16 × ${length}mm (Foot Length)" ;; *) value="$value = 4 × $in\" (Foot Length)" ;; esac ;; CM:) value="$value = 2⅔ × $in\" (Foot Length)" ;; of_Length:) value="${value}%" ;; Label:) value="${value/_/ }" ;; esac echo " $value" >&3 done } # Yes/No Dialog qYN() { local yn printf "$1 [y|n] : " read yn ; [ "$yn" = y ] && return 0 || return 1 } # Check Value ckVal() { if [ -z "$VALUES" ] then echo " Enter an Available Index Number." elif [ "$VALUES" = Quit ] then eXit else break fi } # Create Output and Exit Clean eXit() { local pwd echo >&3 ; exec 3<&- [ "$1" != save ] && { rm $TMP ; exit 1 ; } clear ; cat $TMP echo if qYN "Create Text Output?" then while : do unset pwd printf "Save ${OutFile}.txt in <${PWD}> ? : " read pwd if [ -n "$pwd" ] then # Directory Writeable if [ -d "$pwd" -a -w "$pwd" ] then CWD="$pwd" break else echo " Directory not available." fi else CWD="$PWD" break fi done if mv $TMP "${CWD}/${OutFile}.txt" > /dev/null 2>&1 then echo " ${CWD}/${OutFile}.txt created." qYN "Edit ${OutFile}.txt in $Ed ?" && \ { export CWD ; $Ed ${CWD}/${OutFile}.txt ; } if qYN "Prnt ${OutFile}.txt to Default Printer?" then if lpr "${CWD}/${OutFile}.txt" then echo "Sent to Print Queue." else echo "Failed to Print." sleep 1 exit 1 fi fi else echo "Failed to Create Text File." >&2 sleep 1 exit 1 fi else rm $TMP > /dev/null 2>&1 fi sleep 1 exit } # Add Title unset Ttl ; printf "Specify document title. <${OutFile//_/ }> : " read Ttl ; [ -n "$Ttl" ] && Title="$Ttl" || Title="${OutFile//_/ }" printf "\n$Title\n" >&3 ; l=${#Title} ; l=$(($l+1)) ; tildeline=`printf "% ${l}b" "\n"` ; echo ${tildeline// /\~} >&3 # Gender | Girth:Width Selection # # The girth:width aspect ratio between the genders may be somewhat different. # The narrower width 'B (Womens)' may have a less of a decrease in girth # compared to a 'D (Mens)' width. That is a 'B' width may have a thicker # profile whereas a 'D' width may be more spread out. Along with gender # labels with an associated girth ratio numerical options are also # provided. The gender:girth ratio probably needs some fine tuning. printf "\nSelect Gender | Girth:Width Ratio\n" select GGF in Male Female Unisex 2.40 2.41 2.42 2.43 2.44 2.45 2.46 2.47 2.48 2.49 2.50 Quit do if [ -z "$GGF" ] then echo " Enter a Correct Index Number." elif [ "$GGF" = Quit ] then exec 3<&- ; rm $TMP ; exit 1 else break fi done # Gender / Girth:Width Ratio Set case $GGF in Male) gf=2.45 ;; Unisex) gf=2.46 ;; Female) gf=2.47 ;; *) gf=$GGF ;; esac echo " Gender: ${GGF}, $gf Girth:Width Ratio." >&3 # System Selection printf "\nSelcet Sizing System.\n" select System in Barleycorn "Paris Point" "MondoPoint 5mm" "½cm Last Inc." Quit do if [ -z "$System" ] then echo " Enter a Correct Index Number." elif [ "$System" = Quit ] then exec 3<&- ; rm $TMP ; exit 1 else break fi done printf "\n Sizing System: ${System}\n" >&3 ################## # Size Selection # ################## clear # Paris Point 3⅓mm Last Increment, Foot increment ⅛". if [ "$System" = "Paris Point" ] then COLUMNS=(BR: IT\|EU: FR: Mx: UK: usM: usW: in. mm:) printf "\n Size, 5%% Toe Room" >&3 printf "\nParis Pont Sizes, +5%% Toe Room\n" echo " Select Size Foot Length" echo " $BR $ITEU $FR $Mx $UK $usM $usW in. mm" select VALUES in \ " 31 33 34 0⅖ 0.9 1.9 3⅖ 8¼ 209.6" \ " 31½ 33½ 34½ 0⅘ 1.3 2.3 3⅘ 8⅜ 212.7" \ " 32 34 35 1⅕ 1.7 2.7 4⅕ 8½ 215.9" \ " 32½ 34½ 35½ 1⅗ 2.1 3.1 4⅗ 8⅝ 219.1" \ " 33 35 36 2 2½ 3½ 5 8¾ 222.3" \ " 33½ 35½ 36½ 2⅖ 2.9 3.9 5⅖ 8⅞ 225.4" \ " 34 36 37 2⅘ 3.3 4.3 5⅘ 9 228.6" \ " 34½ 36½ 37½ 3⅕ 3.7 4.7 6⅕ 9⅛ 231.8" \ " 35 37 38 3⅗ 4.1 5.1 6⅗ 9¼ 235.0" \ " 35½ 37½ 38½ 4 4½ 5½ 7 9⅜ 238.1" \ " 36 38 39 4⅖ 4.9 5.9 7⅖ 9½ 241.3" \ " 36½ 38½ 39½ 4⅘ 5.3 6.3 7⅘ 9⅝ 244.5" \ " 37 39 40 5⅕ 5.7 6.7 8⅕ 9¾ 247.7" \ " 37½ 39½ 40½ 5⅗ 6.1 7.1 8⅗ 9⅞ 250.8" \ " 38 40 41 6 6½ 7½ 9 10 254.0" \ " 38½ 40½ 41½ 6⅖ 6.9 7.9 9⅖ 10⅛ 257.2" \ " 39 41 42 6⅘ 7.3 8.3 9⅘ 10¼ 260.4" \ " 39½ 41½ 42½ 7⅕ 7.7 8.7 10⅕ 10⅜ 263.5" \ " 40 42 43 7⅗ 8.1 9.1 10⅗ 10½ 266.7" \ " 40½ 42½ 43½ 8 8½ 9½ 11 10⅝ 269.9" \ " 41 43 44 8⅖ 8.9 9.9 11⅖ 10¾ 273.1" \ " 41½ 43½ 44½ 8⅘ 9.3 10.3 11⅘ 10⅞ 276.2" \ " 42 44 45 9⅕ 9.7 10.7 12⅕ 11 279.4" \ " 42½ 44½ 45½ 9⅗ 10.1 11.1 12⅗ 11⅛ 282.6" \ " 43 45 46 10 10½ 11½ 13 11¼ 285.8" \ " 43½ 45½ 46½ 10⅖ 10.9 11.9 13⅖ 11⅜ 288.9" \ " 44 46 47 10⅘ 11.3 12.3 13⅘ 11½ 292.1" \ " 44½ 46½ 47½ 11⅕ 11.7 12.7 14⅕ 11⅝ 295.3" \ " 45 47 48 11⅗ 12.1 13.1 14⅗ 11¾ 298.5" \ " 45½ 47½ 48½ 12 12½ 13½ 15 11⅞ 301.6" \ " 46 48 49 12⅖ 12.9 13.9 15⅖ 12 304.8" \ " 46½ 48½ 49½ 12⅘ 13.3 14.3 15⅘ 12⅛ 308.0" \ " 47 49 50 13⅕ 13.7 14.7 16⅕ 12¼ 311.2" \ " 47½ 49½ 50½ 13⅗ 14.1 15.1 16⅗ 12⅜ 314.3" \ " 48 50 51 14 14½ 15½ 17 12½ 317.5" Quit do ckVal done Parse # Barleycorn ~⅙" Last Increment, Foot Increment 4mm. elif [ "$System" = Barleycorn ] then COLUMNS=(Mx: UK: usM: usW: BR: IT\|EU: FR: mm: in. Last.mm:) printf "\n Size, 6⅔%% Toe Room" >&3 printf "\nBarleycorn Sizes, +6⅔%% Toe Room\n" echo " Select Size Foot Length" # +6⅔% echo " $Mx $UK $usM $usW $BR $ITEU $FR mm in. Last.mm" select VALUES in \ " ─½ 0 1 2½ 29⅞ 31⅞ 32⅞ 198 7.80 211.2" \ " 0 ½ 1½ 3 30½ 32½ 33½ 202 7.95 215.5" \ " ½ 1 2 3½ 31⅛ 33⅛ 34⅛ 206 8.11 219.7" \ " 1 1½ 2½ 4 31¾ 33¾ 34¾ 210 8.27 224 " \ " 1½ 2 3 4½ 32⅜ 34⅜ 35⅜ 214 8.43 228.3" \ " 2 2½ 3½ 5 33 35 36 218 8.58 232.5" \ " 2½ 3 4 5½ 33⅝ 35⅝ 36⅝ 222 8.74 236.8" \ " 3 3½ 4½ 6 34¼ 36¼ 37¼ 226 8.90 241.1" \ " 3½ 4 5 6½ 34⅞ 36⅞ 37⅞ 230 9.06 245⅓ " \ " 4 4½ 5½ 7 35½ 37½ 38½ 234 9.21 249.6" \ " 4½ 5 6 7½ 36⅛ 38⅛ 39⅛ 238 9.37 253.9" \ " 5 5½ 6½ 8 36¾ 38¾ 39¾ 242 9.53 258.1" \ " 5½ 6 7 8½ 37⅜ 39⅜ 40⅜ 246 9.69 262.4" \ " 6 6½ 7½ 9 38 40 41 250 9.84 266⅔ " \ " 6½ 7 8 9½ 38⅝ 40⅝ 41⅝ 254 10.00 270.9" \ " 7 7½ 8½ 10 39¼ 41¼ 42¼ 258 10.16 275.2" \ " 7½ 8 9 10½ 39⅞ 41⅞ 42⅞ 262 10.31 279.5" \ " 8 8½ 9½ 11 40½ 42½ 43½ 266 10.47 283.7" \ " 8½ 9 10 11½ 41⅛ 43⅛ 44⅛ 270 10.63 288 " \ " 9 9½ 10½ 12 41¾ 43¾ 44¾ 274 10.79 292.3" \ " 9½ 10 11 12½ 42⅜ 44⅜ 45⅜ 278 10.94 296.5" \ " 10 10½ 11½ 13 43 45 46 282 11.10 300.8" \ " 10½ 11 12 13½ 43⅝ 45⅝ 46⅝ 286 11.26 305.1" \ " 11 11½ 12½ 14 44¼ 46¼ 47¼ 290 11.42 309⅓ " \ " 11½ 12 13 14½ 44⅞ 46⅞ 47⅞ 294 11.57 313.6" \ " 12 12½ 13½ 15 45½ 47½ 48½ 298 11.73 317.9" \ " 12½ 13 14 15½ 46⅛ 48⅛ 49⅛ 302 11.89 322.1" \ " 13 13½ 14½ 16 46¾ 48¾ 49¾ 306 12.05 326.4" \ " 13½ 14 15 16½ 47⅜ 49⅜ 50⅜ 310 12.20 330.7" \ " 14 14½ 15½ 17 48 50 51 314 12.36 334.9" \ " 14½ 15 16 17½ 48⅝ 50⅝ 51⅝ 318 12.52 339.2" Quit do ckVal done Parse # MondoPoint 5mm Foot Increment, 5⅓mm Last Increment. elif [ "$System" = "MondoPoint 5mm" ] then COLUMNS=(mm: BR: IT\|EU: FR: Mx: UK: usM: usW: in. Last.mm:) printf "\n Size, 6⅔%% Toe Room" >&3 printf "\nMondoPoint Sizes, +6⅔%% Toe Room\n" echo " Select Size Foot Length" echo " MM $BR $ITEU $FR $Mx $UK $usM $usW in. Last.mm" select VALUES in \ " 205 30.8 32.8 33.8 0.2 0.7 1.7 3.2 8.07 218⅔" \ " 210 31.6 33.6 34.6 0.9 1.4 2.4 3.9 8.27 224 " \ " 215 32.4 34.4 35.4 1.5 2.0 3.0 4.5 8.46 229⅓" \ " 220 33.2 35.2 36.2 2.2 2.7 3.7 5.2 8.66 234⅔" \ " 225 34.0 36.0 37.0 2.8 3.3 4.3 5.8 8.86 240 " \ " 230 34.8 36.8 37.8 3.4 3.9 4.9 6.4 9.06 245⅓" \ " 235 35.6 37.6 38.6 4.1 4.6 5.6 7.1 9.25 250⅔" \ " 240 36.4 38.4 39.4 4.7 5.2 6.2 7.7 9.45 256 " \ " 245 37.2 39.2 40.2 5.4 5.9 6.9 8.4 9.65 261⅓" \ " 250 38.0 40.0 41.0 6.0 6.5 7.5 9.0 9.84 266⅔" \ " 255 38.8 40.8 41.8 6.6 7.1 8.1 9.6 10.04 272 " \ " 260 39.6 41.6 42.6 7.3 7.8 8.8 10.3 10.24 277⅓" \ " 265 40.4 42.4 43.4 7.9 8.4 9.4 10.9 10.43 282⅔" \ " 270 41.2 43.2 44.2 8.6 9.1 10.1 11.6 10.63 288 " \ " 275 42.0 44.0 45.0 9.2 9.7 10.7 12.2 10.83 293⅓" \ " 280 42.8 44.8 45.8 9.8 10.3 11.3 12.8 11.02 298⅔" \ " 285 43.6 45.6 46.6 10.5 11.0 12.0 13.5 11.22 304 " \ " 290 44.4 46.4 47.4 11.1 11.6 12.6 14.1 11.42 309⅓" \ " 295 45.2 47.2 48.2 11.8 12.3 13.3 14.8 11.61 314⅔" \ " 300 46.0 48.0 49.0 12.4 12.9 13.9 15.4 11.81 320 " \ " 305 46.8 48.8 49.8 13.0 13.5 14.5 16.0 12.01 325⅓" \ " 310 47.6 49.6 50.6 13.7 14.2 15.2 16.7 12.20 330⅔" \ " 315 48.4 50.4 51.4 14.3 14.8 15.8 17.3 12.40 336 " \ " 320 49.2 51.2 52.2 15.0 15.5 16.5 18.0 12.60 341⅓" Quit do ckVal done Parse # ½ Centimeter Last Increment, 3/16" Foot Increment. elif [ "$System" = "½cm Last Inc." ] then COLUMNS=(CM: BR: IT\|EU: FR: Mx: UK: usM: usW: in. mm:) printf "\n Size, 5%% Toe Room" >&3 printf "\n½ Centimeter Sizes, +5%% Toe Room\n" echo " Select Size Foot Length" echo " CM $BR $ITEU $FR $Mx $UK $usM $usW in. mm" select VALUES in \ " 22 31 33 34 0.4 0.9 1.9 3.4 8¼ 209.6" \ " 22½ 31¾ 33¾ 34¾ 1.0 1.5 2.5 4.0 8.4375 214.3" \ " 23 32½ 34½ 35½ 1.6 2.1 3.1 4.6 8⅝ 219.1" \ " 23½ 33¼ 35¼ 36¼ 2.2 2.7 3.7 5.2 8.8125 223.8" \ " 24 34 36 37 2.8 3.3 4.3 5.8 9 228.6" \ " 24½ 34¾ 36¾ 37¾ 3.4 3.9 4.9 6.4 9.1875 233.4" \ " 25 35½ 37½ 38½ 4.0 4.5 5.5 7.0 9⅜ 238.1" \ " 25½ 36¼ 38¼ 39¼ 4.6 5.1 6.1 7.6 9.5625 242.9" \ " 26 37 39 40 5.2 5.7 6.7 8.2 9¾ 247.7" \ " 26½ 37¾ 39¾ 40¾ 5.8 6.3 7.3 8.8 9.9375 252.4" \ " 27 38½ 40½ 41½ 6.4 6.9 7.9 9.4 10⅛ 257.2" \ " 27½ 39¼ 41¼ 42¼ 7.0 7.5 8.5 10.0 10.3125 261.9" \ " 28 40 42 43 7.6 8.1 9.1 10.6 10½ 266.7" \ " 28½ 40¾ 42¾ 43¾ 8.2 8.7 9.7 11.2 10.6875 271.5" \ " 29 41½ 43½ 44½ 8.8 9.3 10.3 11.8 10⅞ 276.2" \ " 29½ 42¼ 44¼ 45¼ 9.4 9.9 10.9 12.4 11.0625 281.0" \ " 30 43 45 46 10.0 10.5 11.5 13.0 11¼ 285.8" \ " 30½ 43¾ 45¾ 46¾ 10.6 11.1 12.1 13.6 11.4375 290.5" \ " 31 44½ 46½ 47½ 11.2 11.7 12.7 14.2 11⅝ 295.3" \ " 31½ 45¼ 47¼ 48¼ 11.8 12.3 13.3 14.8 11.8125 300.0" \ " 32 46 48 49 12.4 12.9 13.9 15.4 12 304.8" \ " 32½ 46¾ 48¾ 49¾ 13.0 13.5 14.5 16.0 12.1875 309.6" \ " 33 47½ 49½ 50½ 13.6 14.1 15.1 16.6 12⅜ 314.3" \ " 33½ 48¼ 50¼ 51¼ 14.2 14.7 15.7 17.2 12.5625 319.1" Quit do ckVal done Parse else exec 3<&- ; rm $TMP > /dev/null 2>&1 ; exit 1 fi ################### # Widths & Girths # ################### # Width Selection clear COLUMNS=(of_Length: US: UK: Label: Alt.) printf "\nShoe Widths\n" echo "Select Width (Percent of Foot Length)" echo " Percent $US $UK Label Alt." select VALUES in \ " $A AAA A X_Slim I " \ " $B AA B Slim II " \ " $C A C Narrow III " \ " $D B D MedNar IV " \ " $E C E Medium V " \ " $F D F MedWid VI " \ " $G E G Wide VII " \ " $H EE H X_Wide VIII " \ " $I EEE I 2X_Wide IX " \ " $J 4E j 3X_Wide X " \ " $K 5E k 4X_Wide XI " \ " $N Nar N Narrow III " \ " $M Med M Medium V " \ " $W Wid W Wide VII " \ " Quit " do if [ -z "$VALUES" ] then echo " Enter an Available Index Number." elif [ "${VALUES:1:4}" = Quit ] then eXit save else break fi done printf "\n Width" >&3 Parse # Width factor setting case $width in A) width=$wA ;; B) width=$wB ;; C) width=$wC ;; D) width=$wD ;; E) width=$wE ;; F) width=$wF ;; G) width=$wG ;; H) width=$wH ;; I) width=$wI ;; j) width=$wJ ;; k) width=$wK ;; N) width=$wN ;; M) width=$wM ;; W) width=$wW ;; esac # Calculate and Print MondoPoint Length, Width, and Girth Values. [ ${#length} -gt 3 ] && l=${length/./} || l="${length}0" w=$(( ($width * $l / 1000 + 5) / 10 )) ; c=$(( ${#w} - 1 )) gf=${gf/./} ; g=$(( ($l * $width * $gf / 100000 + 5) / 10 )) b=$(( (4 * $l * $width * $gf / 387409 + 5) / 10 )) printf "\n MondoPoint\n" >&3 echo " Length: ${l:0:3}.${l:3:1} mm" >&3 printf " Width: " >&3 ; printf "% 9b" "${w:0:$c}.${w:$c:1} mm\n" >&3 echo " Girth: ${g:0:3}.${g:3:1} mm" >&3 echo "Weight Bearing: ${b:0:3}.${b:3:1} mm, ~+3¼%" >&3 # Add Notes. if qYN "Add any Notes?" then printf "\nNOTE: To End use Ctrl-D on a New Line.\n\n" printf "\nNotes:\n" >&3 cat >&3 fi eXit save exit 1