Update to use POSIX-compliant shell code