I am redesigning a script where most of the code is to be broken into functions and only the main flow control logic will be in the “main” part of the script. I tested simple scripts and functions to see how bash handles work, and if I got this right, a situation is possible where function3 may need to call function5. Do I need to define function3 before function3 and all functions before I code the control loops and if statements? And will all the functions be available in the main scriptif I source the file containing them from within the main script?
I suggest follow the link below