It is the condition of the if statement to check leap year.
if[ ((${year}%4 -eq 0 ) && (${year}%100 -ne 0 )) || (${year}%400 -eq 0) ] then ... fi
The conditions I put in are, "Once every four years, a year that is not a multiple of 100 or a year that is a multiple of 400." It's an index
syntax error near unexpected token `then'
` then'
There's an error like this..
Please help me.
linux shell-script if문
Do it like this.
if (($year % 4 == 0 )) && (($year % 100 != 0 )) || (($year % 400 == 0))
© 2024 OneMinuteCode. All rights reserved.