jdb@mordor.UUCP (12/07/83)
I would recommend NOT changing system(), popen(), etc. to use SHELL. It is desirable to have a standard interface that programs can rely upon when performing a system() or popen(); this is not the case if the shell which is used varies from one user to another. An example is the "make" program -- a number of makefiles depend upon the use of "/bin/sh" (which I believe is perfectly reasonable for them to do). [An even better approach would be to specify the desired shell as an equivalenced parameter in the makefile.] Editors and other programs which have shell escapes should use SHELL because the human who is typing input to them presumably wants to use the same shell as his login shell. Non-interactive uses, however, normally will "want" a predetermined shell. I admit that system(), popen(), and friends are too useful to ignore the possibility of other shells completely. Perhaps a new routine ("systemsh()"?) could be defined which would specify the command interpreter that these routines would use, with "/bin/sh" still the default. This way, programs that want "csh" can get it. It would be necessary to explicitly define the shell to be used. Programs could specify 'systemsh(getenv("SHELL"))'; hopefully, the fact that an explicit specification is needed will cause the programmer to think about whether the program will break if the user's login shell is not the same as the programmer's. -- John Bruner (S-1 Project, Lawrence Livermore National Laboratory) MILNET: jdb@s1-c UUCP: ...!decvax!decwrl!mordor!jdb