Skip to content

Instantly share code, notes, and snippets.

@f9n
Created September 8, 2017 20:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save f9n/391ae7fc290ab3acffee4b0c5a04f2b3 to your computer and use it in GitHub Desktop.
Save f9n/391ae7fc290ab3acffee4b0c5a04f2b3 to your computer and use it in GitHub Desktop.
ShellScript, [A-Z] match lowercase letters
#!/bin/bash
# https://unix.stackexchange.com/questions/92445/bash-script-check-if-a-variable-is-in-a-z
# Exampl1
echo -e "Enter a character: \c"
read value
# LC_ALL=C or LANG=C
case $value in
[a-z] )
echo "$value => a to z" ;;
[A-Z] )
echo "$value => A to Z" ;;
* )
echo "Unknown input" ;;
esac
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment