simulate setevn by using getenv and putenv