diff --git a/SC2081.md b/SC2081.md index 10902d4..a5fe078 100644 --- a/SC2081.md +++ b/SC2081.md @@ -25,6 +25,12 @@ In bash/ksh, you can instead use `[[ .. ]]` which supports this behavior. In sh, you can rewrite to use `grep`. +```sh +if echo $var | grep -q '^[0-9]*$'; then + echo "$var is numeric" +fi +``` + ### Exceptions: None. If you are not trying to match a glob, quote the argument (e.g. `[ $var == '*' ]` to match literal asterisk. \ No newline at end of file