Just use ksh (ksh93 precisely), which supports floating point arithmetics natively:
$ cat test.ksh #!/bin/ksh min=12.45 val=10.35 if (( $val < $min )) ; then min=$val fi echo $min $ ./test.ksh 10.35 Edit: Sorry, I missed ksh93 was already suggested. Keeping my answer just to make clear the script posted in the opening question can be used with no change outside the shell switch.