Path: utzoo!attcan!uunet!husc6!mailrus!tut.cis.ohio-state.edu!osu-cis!att!ihnp4!skep2!wcs From: wcs@skep2.ATT.COM (Bill.Stewart.) Newsgroups: comp.sources.bugs Subject: Re: Jove bug Message-ID: <108@skep2.ATT.COM> Date: 16 May 88 22:45:55 GMT References: <321@syntron.UUCP> <4071@killer.UUCP> Reply-To: wcs@skep2.UUCP (46323-Bill.Stewart.,2G218,x0705,) Organization: AT&T Bell Labs Center 4632, Holmdel, NJ Lines: 34 [ Summary of the bug - if the PWD variable is present, Jove 4.9 assumes [ that ksh is keeping it up to date, and uses it instead of getcwd(). [ This is a problem if you aren't using ksh, but have PWD in your [ environment from a parent process, because it's presumably wrong. In article <4071@killer.UUCP> elg@killer.UUCP (Eric Green) writes: } I "solved" the problem simply by commenting out the getenv("CWD") and } getenv("PWD") calls, and falling through into the getcwd() call. But } that's no permanent solution. [..] } It's not a bug in csh. csh doesn't need fixing (though Sys V does :-). csh } isn't supposed to maintain the "PWD" environment variable. If csh was my } login shell, that would be no problem -- there would be no "PWD" environment } variable, and Jove would fall through into the getcwd(). If you think ksh maintaining $PWD is a bug, better excise $cwd from csh :-). As a workaround, in your .login (if applicable) or .cshrc, do unsetenv PWD setenv SHELL=/bin/csh ## whatever the syntax is? The general problem is how to detect when an environment variable has a reliable meaning - at minimum, you should only use $PWD if it's non-null and $SHELL is ksh, but even that's unreliable. Better to just let Jove getcwd(). In a shell script, you can distinguish between Bourne sh and ksh reliably by checking if [ "$RANDOM" = "$RANDOM" ] but that's no help from an executable. -- # Thanks; # Bill Stewart, AT&T Bell Labs 2G218, Holmdel NJ 1-201-949-0705 ihnp4!ho95c!wcs # skep2 is a local machine I'm trying to turn into a server. Please send # mail to ho95c or ho95e instead. Thanks.