Combined improvement of shell scripts
- quote arrays/variables to avoid globbing/splitting
- exit on failed cd calls
- group file directs for consecutive command outputs
- define default exit values and set exit value explicitly for
tests which succeed
- comment vim modeline instructions
- use uniform quoting style
- use uniform indentation
This makes ShellCheck pass with no errors/warnings.
Signed-off-by: Georg Pfuetzenreuter <mail@georg-pfuetzenreuter.net>