Not too experienced with Bash. But I do know that you have to quote your variables!
Also it's useful to use SpellCheck.
The proper she-bang for Bash is #!/usr/bin/env bash.
Defensive BASH Programming
Safe ways to do things in Bash (HN comments)
Pure Bash Bible - Collection of pure bash alternatives to external processes.
Bash Infinity - Modern boilerplate / framework / standard library for Bash.