revise main snippet to conform POSIX.1