I don't know how else to word this so I'll do my best to explain. I have a function
main()
{
if [[ "$1" = "-f" ]]
then
($sendFirstEmail) "$1"
elif [[ "$1" = "-s" ]]
then
($sendSecondEmail) "$1"
elif [[ "$1" = "-k" ]]
then
($sendKillEmail) "$1"
else
echo "valid input not provided"
fi
}
That I call like this main "$1"
what I need to do is pass another argument into the other functions inside the main function that also takes the first argument passed to it. $sendFirstEmail etc. are the names of the other functions that also take the first argument passed to them. In essence this is how I want to call the script ./sendEmail.sh -f [email protected]
Is this possible or is there a better way to achieve what I'm trying to do?
sendFirstEmail
,sendSecondEmail
,sendKillEmail
variables inside subshells? Are those really variables or are they just functions? (Functions don't need to be called with$
...in fact that can't be)sentFirstEmail
is defined.