Check if a value is a positive number greater than zero.
Code
Utilities[[ "$value" =~ ^[0-9]+\.?[0-9]*$ && $(echo "$value > 0" | bc -l) -eq 1 ]] && echo "true" || echo "false"Parameters
Value to validate.
Server
More Bash Snippets
Check Password Strength
Check if a password meets strength requirements (8+ chars, uppercase, lowercase, number, special).
Is Alpha Only
Check if a string contains only alphabetic characters.
Is Alphanumeric
Check if a string contains only letters and numbers.
Is Empty
Check if a value is empty.
Is Numeric
Check if a string represents a valid number.
Validate Email
Check if a string is a valid email address.