Improve POSIX compliance of shell snippet.