> The fact that we always use lib$spawn and never use execvp() like the
> docs say we should do is a separate but related problem.  Switching
> to use execvp() when we can would not, as far as I can tell, help
> with redirection.  There is nothing in the CRTL docs about
> redirection operators being supported as arguments to the exec()
> family.

The actual redirection needs to be handled separately, that's true but using
exec makes it at least possible. The code implementing redirection can be
copied from bash.

> POSIX specifies a  2K limit for the shell command buffer, though I
> believe many unices support more or even have no concrete limit.  I
> have no idea what bash on VMS supports.  The cases you are talking
> about that can be done with the exec() family probably can bypass
> that limit, but strictly speaking they aren't really commands; they
> are images invoked with C-style argv arrays passed to them.
> Distinguishing between when you can use exec() and when not strikes
> me as a bit tricky; it's hard to parse a shell command (or determine
> whether it even is a shell command) without using the command shell
> to do it.

A perfectly reasonable solution would be to provide an alternate version of
system that uses exec, and let the user decide which one to use.



Reply via email to