My Tech Notes
Search This Blog
Bash: check if number is odd or even
n=12 if [[ $((n % 2)) -eq 0 ]]; then echo "even" else echo "odd" fi
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment