If $HOME is not set (running from cron perhaps), the tests will output: 26d25 < ./comsub-posix.tests: line 103: cd: HOME not set 28d26 < ./comsub-posix.tests: line 106: cd: HOME not set --- tests/comsub-posix.tests 2016-11-29 03:41:57.414081235 +0000 +++ tests/comsub-posix.tests 2016-11-29 03:36:30.425718528 +0000 @@ -1,4 +1,5 @@ - +HOME=${HOME:-/} +export HOME # works right echo ab$(echo mnop)yz # works right