Run a bash script and have a main() function like in C.

How to run a bash function when a script runs. This is just like the main() function in C.