Return to Snippet

Revision: 41888
at February 24, 2011 09:17 by yoblob


Initial Code
[[ -z "$1" ]] && echo "I cant work without an input" && exit 1

INPUT="$@"

[[ "$INPUT" == ?(+|-)+([0-9]) ]] && echo "$INPUT is numeric" && exit 0

[[ "$INPUT" == +([a-zA-Z]) ]] && echo "$INPUT is character" && exit 0

[[ "$INPUT" == *([0-9]|[a-zA-Z])* ]] && echo "$INPUT is alpha-numeric" && exit 0

Initial URL

                                

Initial Description
checks for
number
character
alphanumeric

Initial Title
check type of input

Initial Tags
Bash

Initial Language
Bash