The following code:
weekday=$(date +%a) day=$(date +%d) month=$(date +%m) if [[ ( $month == 03 || $month == 10 ) && $weekday = "Sun" && $day > 24 ]] then # DO SOMETHING exit 1 else # DO SOMETHING fi
leads to the error:
8: Syntax error: word unexpected (expecting ")")
when executing with:
/bin/sh script.sh
What is wrong here and how can this be fixed?
I need to use sh how i need to modificate this code to get working with sh?
[[...]]
syntax is not available in plain sh. Run your code with/bin/bash