Re: getenv
- Posted by Jeremy Cowgar <jeremy at ?o?gar.com> May 30, 2008
- 645 views
Matt Lewis wrote: > > It's true that you want to smooth out a lot of the differences, but at some > point you have to recognize that they're different operating systems, and > that there are probably valid reasons for letting that come through to > the coder. I'm not sure if this is one of those cases, but it's certainly > a candidate in my book. > In all my Linux experience I've never seen anything depend on an empty env var. For instance: export ABC that just doesn't happen. export ABC=1 or export ABC=YES happens, which is fine. My suggestion would be to forget about trying to make Windows and DOS work just as Linux, but make Linux act like Windows. That's easy and it's practical. Due to how getenv() works in linux, your checks would have to be: var = genenv("ABC") if atom(var) or length(var) = 0 then ... end if and that's what most people will have to do. Again, while my knowledge is not infinite on Linux I do have a great deal of experience, I have never seen simply the ABC var being in existence triggering something. It's ABC=1, ABC=YES, etc... -- Jeremy Cowgar http://jeremy.cowgar.com