use os.environ, os.access()
check if cmd is executable