I wrote a bash script that runs curl only during working hours. For some reason, the hourly comparison fails when I add the -a operator (and for some reason my bash does not recognize "& &").
Despite the fact that the script is much larger, here is the corresponding snippet:
HOUR=`date +%k` if [ $HOUR > 7 -a $HOUR < 17 ]; then //do sync fi
The script gives me an error:
./tracksync: (last line): Cannot open (line number): No such file
However, this comparison is not subject to:
if [ $DAY != "SUNDAY" -a $HOUR > 7 ]; then //do sync fi
Is my syntax incorrect or is it a problem with my bash?
source share