Created
November 1, 2021 05:45
-
-
Save 4piu/1722097a76bc6d32dcbe127539a5c788 to your computer and use it in GitHub Desktop.
Invoke function in sh
This file contains 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
#!/usr/bin/env sh | |
a () { | |
echo "invoke a" | |
} | |
b () { | |
echo "invoke b" | |
} | |
if [ "$1" = "a" ]; then | |
a | |
elif [ "$1" = "b" ]; then | |
b | |
else | |
echo -e "Invalid args\nUsage:invoke.sh [a|b]" | |
exit 1 | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment