Skip to content

Instantly share code, notes, and snippets.

@sheilambadi
Last active August 6, 2020 21:52
Show Gist options
  • Save sheilambadi/417435f622edc308f58106a6f2b78e6e to your computer and use it in GitHub Desktop.
Save sheilambadi/417435f622edc308f58106a6f2b78e6e to your computer and use it in GitHub Desktop.
Conditional integer comparison example
#!/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