It would look something like the following:
my_functions(){
while getopts ":a" Option
do
case $Option in
a ) echo "a" ;;
* ) ;;
esac
done
}
Then you would call it with:
function -ab
Is this possible or is there a better way to do it?
The syntax is correct, but this specific example suffered from a poor choice for the function name. This should do it: