In my script I wrote down this control expression:
if ! [[ $start -gt $(cut -f3 rooms.txt) -a $end -gt $(cut -f4 rooms.txt) ]]; then
echo "Invalid prenotation";
./prenote.sh;
fi
start and end are simple numbers. Each record in file rooms.txt is built in this way:
room;date;start;end;username
There are non blank spaces in the record. When I run the script I get a syntax error near the if statement.
Can someone tell me where the error is? Thanks
[[-a filenameis true if the file exists. So-ahas a different meaning inside[(test) and[[. By the way, you don't need a semi-colon at the end of every line.