Need some help in fixing simple bash script below. What it does is to compare dates in epoch format using if else. The script does not work as I intended because it always goes to the first condition DEPLOY all the time.
Even if I set the deploymentDate variable to be greater than currentDate it still goes to the first condition.
Can anyone suggest on how to fix it?
#!/bin/bash
currentDate=$(date +s% )
deploymentDate=1513516201
if [ "$currentDate" > "$deploymentDate" ]
then
XSL="DEPLOY"
else
XSL="DO NOT DEPLOY"
fi
echo $XSL
Output
DEPLOY