Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!utgpu!water!watnot!watmath!clyde!bellcore!faline!scherzo!allegra!mit-eddie!husc6!seismo!mcvax!ukc!its63b!simon From: simon@its63b.UUCP Newsgroups: comp.unix.wizards Subject: Re: "make" SHELL variable Message-ID: <312@its63b.ed.ac.uk> Date: Wed, 4-Mar-87 10:18:46 EST Article-I.D.: its63b.312 Posted: Wed Mar 4 10:18:46 1987 Date-Received: Sat, 7-Mar-87 01:11:29 EST References: <3953@brl-adm.ARPA> <2590002@hpisod2.HP> Reply-To: simon@its63b.ed.ac.uk (ECSC68 S Brown CS) Organization: I.T. School, Univ. of Edinburgh, U.K. Lines: 42 In article <688@rtech.UUCP> daveb@rtech.UUCP (Dave Brower) writes: >Many people have complained about or been bitten by the SV make's >importation of the SHELL variable. It certainly catches me by surprise >once every six months or so. > >Therefore, I reluctantly say that this behaviour is _correct_, and that the >wishes that it would ignore SHELL are _wrong_. > >If you need to have environment variables visible to make, the only >reasonable thing to do is to take all of them. Ok, whether it should do it or not is a bit contentious, but I'm sure everyone will agree that if it *does* import variables from the environment, it SHOULD DO IT PROPERLY!!! (thump desk with fist :-)). At present, it binds environ variables to make variables using the wonderful strategy: oh look, they've put "glorkz=mumble" in their environment, so I'll treat that just like a "glorkz=mumble" assignment in Make. I'll just use my standard way of doing this, ie parse it into = , where any blank space around the "=" is ignored. This is fine for most variables (ie, no nasty surprises), but if the value of the string happens to begin with characters that Make considers to be blank space, then these get removed. THIS IS A BUG!! (For example, IFS= gets turned into IFS=). The only way to get 'round this is to explicitly put double-quotes around the values of shell-variables which you suspect might have "blanks" at the start (sort of, `IFS=\"\"'), but this is obviously dead crappy (and causes problems in other places instead). I guess it's what I deserve for doing a "export *" :-) Simon. -- ---------------------------------- | Simon Brown | UUCP: seismo!mcvax!ukc!{its63b,cstvax}!simon | Department of Computer Science | JANET: simon@uk.ac.ed.{its63b,cstvax} | University of Edinburgh, | ARPA: simon@{its63b,cstvax}.ed.ac.uk | Scotland, UK. | ---------------------------------- "Life's like that, you know"