As you have seen, there are some differences between shells, so choose a book (if you are after a book...) that is for the shell you use most, my knowledge is from old when I followed a course on HP-UX ( 8 at the time...).
A simple book like UNIX in a Nutshell is a good start
There is a great book on Korn shell (but cant remember fro who...)
At a more advanced level and more bash specific is a book by one of our forum member:
Shell Scripting Recipes A Problem-Solution Approach by C.F.A Johnson at Apress (Yes I have it, that is why I say more advanced... It is IMHO really tough if you know little... but such a good book when searching for a solution when you are short of time...)
Then you have loads of documentation online look here:
Senior Advisor - https://www.unix.com
There is a bash tutorial also very good online ( I let you search for it...)
And most important
Here!
Submit your work, and explain what you want (better code, have an issue etc...).
Remember that you can set a sheli in debug mode (set -x).
And as in my script when it is time to debug, echoe a maximum to trace where you are,
When you are satisfied with your code you can always remove them or at least most of them ( or comment them out if you are going to modify and complexify your program after...)
Good luck!
(Dont forget tosue code tags!)