Doing some code refactoring, and I realized I don't know if this matters at all:
The function definition is going to be sourced from another file (a sort of library). The function uses certain variables within the function body. Those variables will be set by the time the function is actually called in the script, but it will be much cleaner if I can source the function library at the start of the script; however the variables aren't defined at this point.
Is there any disadvantage to doing this? As far as I know bash won't actually do anything with a function definition until it is called...right? In which case the unset variables used within the function won't matter, since those variables will contain the correct values later, before the function is actually called.
Or will it mess things up to include so-far-unset variables in a function definition?