Patches from Lloyd Parkes in PR 41684, plus my changes:* ${HOSTNAME} is special to bash, so rename the variable to HOSTNAME_CMD.* Don't use "cd -".* Don't use only comments in the else part of an if statement.