From: sm (Steve Haflich)

Subject: Re: [spr11320] RUN-SHELL-COMMAND

Date: 1994-8-25 4:16

[This matter has been assigned the tracking identifier "spr11320".
Please refer to it in any followup communication.  Also, be sure
to cc <franz.com at bugs> so that if I am unavailable someone else will
be able to respond.]

   To: <cs.berkeley.edu at allegro-cl>
   Subject: RUN-SHELL-COMMAND
   Date: Tue, 23 Aug 1994 15:25:36 -0400
   From: "John D. Burger" <linus.mitre.org at john>

   Is there any way to control how RUN-SHELL-COMMAND starts a child shell
   process?  Currently, it seems to invoke csh (or tcsh, the shell I
   use).  This is fine, except that my .cshrc file gets read in, which
   (in my case, at least) adds 1 to 2 seconds to the shell call.

There has been some discussion in the past about additional features
for starting subprocesses: process-group control, starting without
mediation of a shell, but searching the normal Unix PATH.  None of
this has been implemented -- we'll have to look it over again for the
next release -- but the particular piece you want shouldn't be too
difficult to put together.

Internally, excl:run-shell-command invokes a shell approximately thus:

	if (getenv("SHELL") != 0)
	    execlp(getenv("SHELL"),getenv("SHELL"),"-c",command,0);
	execlp("csh","csh","-c",command,0);
	execlp("sh","sh","-c",command,0);

It might be sufficient for your needs to set the value of the SHELL
environment variable to "/bin/sh" since that won't read any
initialization files and will start very quickly.

If /bin/sh isn't sufficient, you could set the value of SHELL to be
your own custom wrapper program.

One of the ACL UG examples for excl:run-shell-command (bottom of
p.8-2) shows how to "putenv" Unix environment variables like SHELL.
If you copy this putenv code something like this into your program,
you might want to conditionalize the putenv forms inside a
#-(version>= 4 2)(progn ...) because starting with the next release
sys:getenv will be directly setfable.

Get back to us if you need any more help figuring this out.