I have a shell script which conditionally calls a function.
For Example:-
if [ \"$choice\" = \"true\" ]
then
process_install
elif [ \"$choice\" =
The functions need to be defined before being used. There is no mechanism is sh to pre-declare functions, but a common technique is to do something like:
main() {
case "$choice" in
true) process_install;;
false) process_exit;;
esac
}
process_install()
{
commands...
commands...
}
process_exit()
{
commands...
commands...
}
main()