Created
January 24, 2012 14:56
-
-
Save alxf/1670552 to your computer and use it in GitHub Desktop.
Auto generated command shell script
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
# | |
# ./command.sh help | |
# HELP MESSAGE | |
# ./command.sh first | |
# FIRST COMMAND | |
# | |
command_help() | |
{ | |
echo "HELP MESSAGE" | |
} | |
command_first() | |
{ | |
echo "FIRST COMMAND" | |
} | |
case $1 in | |
*) | |
if type "command_$1" > /dev/null 2>&1; then | |
cmd="$1" | |
shift | |
eval "command_$cmd $@" | |
fi | |
;; | |
esac |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment