I'm trying to write a simple script to check if the current hour is before or after 12:00 AM.
#!/bin/bash var1=`date +"%T"` # error "not an integer" var2='12:00:00' if [ $var1 -lt $var2 ]; then # always false echo "Good morning!" else echo "Good afternoon!" fi
The error says that var1 must be an integer number, and the condition is always false. I would like some help please. Thank you very much.