remove unused functions, change error message, add emkstemp()
change usage, add isatty(), refer TMPDIR env
update static version
update scripts