Use bc $ echo "0.8 0.7" | bc 1 $ echo "0.8 0.7" | bc 0 $ echo ".08 0.7" | bc 0 use awk x = "0.80" y = "0.70" result = $ ( awk - vx = $x - vy = $y 'BEGIN{ print x=y?1:0}' ) if ; then echo ...
To check if a directory exists in a bash shell script you can use the following: if ; then # Control will enter here if $DIRECTORY exists fi Or to check if a directory doesn't exist: if ; then # Control will enter here if $DIRECTORY doesn't exist fi if ; then i ...