From 229a87c330033463046ca8fbd3a397ea12d0e196 Mon Sep 17 00:00:00 2001 From: Luke Bratch Date: Wed, 21 Nov 2018 23:02:12 +0000 Subject: Use $(()) instead of $(expr) --- certexpiry.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/certexpiry.sh b/certexpiry.sh index ea2feeb..72ef8f8 100755 --- a/certexpiry.sh +++ b/certexpiry.sh @@ -59,14 +59,14 @@ while read HOSTANDPORT ; do # echo "DEBUG: NOW: $NOW." # Number of seconds left - DIFFERENCE=$(expr "$EXPIRY" - "$NOW") + DIFFERENCE=$(("$EXPIRY" - "$NOW")) # echo "DEBUG: DIFFERENCE: $DIFFERENCE." # Warn if less than WARNSECONDS less if [ "$DIFFERENCE" -lt "$WARNSECONDS" ] ; then - echo "Warning! The certificate at $HOST:$PORT expires in $DIFFERENCE seconds (~$(expr $DIFFERENCE / 60 / 60 / 24) days)." + echo "Warning! The certificate at $HOST:$PORT expires in $DIFFERENCE seconds (~$((DIFFERENCE / 60 / 60 / 24)) days)." # else -# echo "DEBUG: The certificate at $HOST:$PORT expires in $DIFFERENCE seconds (~$(expr $DIFFERENCE / 60 / 60 / 24) days)." +# echo "DEBUG: The certificate at $HOST:$PORT expires in $DIFFERENCE seconds (~$((DIFFERENCE / 60 / 60 / 24)) days)." fi done < "$HOSTSANDPORTS" -- cgit v1.2.3