Path: utzoo!attcan!uunet!lll-winken!lll-tis!ames!mailrus!cornell!rochester!ritcv!cci632!ccicpg!nick From: nick@ccicpg.UUCP (Nick Crossley) Newsgroups: comp.unix.wizards Subject: Re: Make & .cshrc Message-ID: <25177@ccicpg.UUCP> Date: 19 Sep 88 17:41:31 GMT References: <452@alice.marlow.uucp> <67870@sun.uucp> <67925@sun.uucp> <24946@ccicpg.UUCP> <68801@sun.uucp> Reply-To: nick@ccicpg.UUCP (Nick Crossley) Organization: CCI CPG, Irvine CA Lines: 52 In article <68801@sun.uucp> guy@gorodish.Sun.COM (Guy Harris) writes: >Fine. Plenty of other people don't like it, because it causes makefiles to >exhibit incorrect behavior when invoked by users with shells other than the >Bourne shell. There is, admittedly, a workaround/fix for this - namely, >putting "SHELL=/bin/sh" at the beginning of all your makefiles - but it's still >kind of impolite to require people to change their makefiles in this fashion, >especially if you don't tell them they have to do this. > This is not necessay, because SysV make also imports all environment variables as make variables. Thus one can write :- make SHELL=/bin/sh ... or SHELL=/bin/sh make for one-off makes, and 'alias Make=' for other occasions. The -e flag to make (environment values override local settings) can also be useful. >Now, maybe you rate your convenience above the convenience of those other >people. I suspect those other people would rate things differently, and in >general "don't gratuitously break things" is considered a good rule. This is a valid argument against any change, but since the 'fix' is so trivial, I do not consider it overwhelming in this case. >I tend to doubt that there are many Makefiles or shell scripts that absolutely >*NEED* ksh. There are many that might be more *convenient* to write using >"ksh", but I suspect they can all be done without Korn shell features. > >I suggest you learn to do your development without using those features in your >scripts. I use the Korn shell as my shell, but I make a point of *not* using >Korn shell features in scripts and the like, because I have no idea whether >somebody else will have the Korn shell available to them. If I were to do this, why should I use the Korn shell at all? Why should we ever change and enhance anything? Of course I *can* do anything with sh, but some things are *much* easier to write using ksh. My reasons for using ksh are not just the interactive features (command editing and history, etc.); I switched from sh to ksh partly because of the improved script facilities, arithmetic and bug fixes in features like functions. The one point I would agree on is that it is sometimes unfortunate that the environment value used is just 'SHELL', as that also affects the shell launched by vi, etc. I would like for that always to be ksh, but for make to use sh sometimes. Currently I use a Make alias as above, but a better solution would be for make to look for the environment variable 'MAKESHELL', and default to 'SHELL' (or /bin/sh if you insist) if that did not exist. In fact the latter solution should satisfy both of us, should it not? -- <<< standard disclaimers >>> Nick Crossley, CCI, 9801 Muirlands, Irvine, CA 92718-2521, USA Tel. (714) 458-7282, uucp: ...!uunet!ccicpg!nick