Created
May 14, 2012 15:14
-
-
Save shkumagai/2694512 to your computer and use it in GitHub Desktop.
Can I use regex in case expression?
This file contains hidden or 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/sh | |
case $1 in | |
[1-9]) | |
echo "Less than 10: $1" | |
;; | |
[1-9][0-9]) | |
echo "Greater than equal 10, and Less than 100: $1" | |
;; | |
*) | |
echo "Greater than equal 100 or not integer: $1" | |
esac |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment