I do not personally understand anything about all the things you are writing about but, as Frank Nikolajsen wrote: "...I'm not the world's greatest bash hacker.", I just wanted to inform that there is a recently updated Advanced Bash-Scripting Guide online.
Sorry for disturbing, in case such a hint is too basic for you.