Last active
August 6, 2020 21:52
-
-
Save sheilambadi/417435f622edc308f58106a6f2b78e6e to your computer and use it in GitHub Desktop.
Conditional integer comparison example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
variable=$1 | |
if [ $variable -lt 0 ]; then | |
echo Variable is less than 0 | |
elif [ $variable -eq 0 ]; then | |
echo Variable is equal to 0 | |
elif [ $variable -gt 0 ]; then | |
echo Variable is greater than 0 | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment