I have this bash script [it is more complex but putting only relevant bits] and I want to skip running it the hours is between 9pm and 7pm. Here it is:
#!/bin/sh
currenttime=$(date +%H:%M)
# echo ${currenttime}
if [[ "$currenttime" > "21:00" ]] || [[ "$currenttime" < "07:00" ]]; then
echo 'Gitlab might be down at these hours, skipping translation sync script' 1>&2
exit ${EXIT_CODE}
fi
It works like expected but for the love of life I cannot figure out why it is creating an empty file called 21:00
in the folder of the .sh script:
Can you help me out and make the code not generate that empty file? What's the deal, why only for 21:00 it creates that? I am not the best at bash scripts.