Skip to content

Instantly share code, notes, and snippets.

@4piu
Created November 1, 2021 05:45
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 4piu/1722097a76bc6d32dcbe127539a5c788 to your computer and use it in GitHub Desktop.
Save 4piu/1722097a76bc6d32dcbe127539a5c788 to your computer and use it in GitHub Desktop.
Invoke function in sh
#!/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