Things I Wish I'd Known About Bash
I wasted a lot of time on this one:If you declare a local variable and set it in the same step e.g: local MYVAR = $(/bin/false)
The return code you get is from the local declaration, not assigning a value to the variable. It can be quite confusing when you afterwards check the return code with $? and it returns 0. Avoid it by assigning the value in a seperate command.