I am trying to create a custom Mac Terminal command, start, In Terminal, my intent is to write $ start func1 subfunc myText, where func is a function in the start.sh file and subfunc is a function only in func that can only be called from in func. So $ start subfunc myText wouldn't be possible. I see that its possible to pass a function from another (Here), but only when both are in the outer scope of the start.sh file.
Basically:
start.sh:
function func(){
function subfunc(){
echo $1
}
}
and then in Terminal:
$ start func subfunc Hey prints Hey
start subfunc myTextcan still dostart func subfunc Heydo still callsubfuncanyway. What problem are you trying to solve with this?if [$command = "func"]if [ $subcommand = "subfunc"]sort of thing... IT may help if you explained what you are trying to achieve though since it's not clear from your very not-working code.