Shell script cleanups: - Add required space to [ -n ]. - Avoid quote within quote. - Exit if cd fails. - Remove \n which is not handled by echo.
Backport of core PR10773
https://github.com/bitcoin/bitcoin/pull/10773/files
Note: tidy_datadir.sh, gitian-build.sh and verify_commits.sh have
been deleted from our codebase.
Depends on D3955.