I have shell script in which i have to check if time is between to possible value or not. For that i am using following line of code
if [ "$ftime" -gt 01:00 && "$ftime" -lt 05:00 ]
then
echo 'Found In Between'
echo $ftime
fi
but when i am executing the script i am getting
test: ] missing
error.
mmm...
I think -gt, -lt, etc... are for integers and not for dates. At least in my AIX, where "man test" shows:
[...]
Integer1 -eq Integer2 Returns a True exit value if the Integer1 and Integer2
variables are algebraically equal. Any of the comparisons -ne, -gt, -ge, -lt,
and -le can be used in place of -eq.
[...]