BASH:check if a number is even or odd


In a bash script you might need to check if a var is even or odd , 

in my case im going to use a if to make that check

You can use this simple code to make that check and display the result.

the result will be : 

4 thoughts on “BASH:check if a number is even or odd

  1. Tested on Mac and Linux. None of them worked. The syntax is totally wrong. Why does this result appear on the top of google search???

Leave a Comment

Your email address will not be published. Required fields are marked *