Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- # Do different things depending on input from first argument when script was called.
- case $1 in
- "Value" ) # If $1 = "Value"
- echo "First case" ;;
- [a-z] ) # If $1 = any value from a to z
- echo "Second case" ;;
- [1-9] ) # If $1 = any value from 1 to 9
- echo "Third case" ;;
- Value_* ) # If $1 = Value_<anything>
- echo "Fourth case" ;;
- ? ) # If $1 = Any single character
- echo "Fifth case" ;;
- * ) # Default case
- echo "Sixth case" ;;
- esac
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement