I am trying to write a bash script that takes some data from users and display their entered information back to them. I take date and time using following:
echo "Enter day:"
read day
echo "Enter time (hour):"
read hour
if [["$hour" -gt 24 || "$hour" -lt 1]]
then
echo "Wrong data"
echo "Enter time (hour):"
read hour
fi
When I run this I get following enter:
./file1.sh: line 5: [[27: command not found
./file1.sh: line 5: 27: command not found
27 is the number I entered for hour.