Update some scripts to be more POSIX-friendly