Use #!bin/sh more portable shebang. Support filenames with spaces. Set HAPROXY_PROGRAM environment variable value to ${PWD}/haproxy. exit(1) if we could not creat the higher level temporary working directory or create its sub-directory with mktemp utility. As defined by POSIX, use six characters for the mktemp template.