"make" SHELL variable

simon at its63b.UUCP simon at its63b.UUCP
Thu Mar 5 01:18:46 AEST 1987


In article <688 at rtech.UUCP> daveb at 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
	<name> = <value>, 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=<space><tab><newline> gets turned into IFS=<null-string>).

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=\"<space><tab><newline>\"'), 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 at uk.ac.ed.{its63b,cstvax}
| University of Edinburgh,       | ARPA:  simon@{its63b,cstvax}.ed.ac.uk
| Scotland, UK.		         |
----------------------------------	 "Life's like that, you know"



More information about the Comp.unix.wizards mailing list