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 :
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 :
How would you input this script together to find a prime number?
Finding prime is way more complex to simply checking if the number is even or odd
a quick search gave me sthis : https://stackoverflow.com/questions/39002533/prime-number-script-checker
good luck
You could also use a range instead of `seq`:
for i in {1..99}
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???
CC – The same thing happened to me when I cut-n-pasted the code. When I deleted the leading spaces on every line, it worked fine.