Op 02-08-17 om 22:17 schreef Thorsten Glaser:
> Robert Elz dixit:
> 
>> The only way that the standard will ever say that "exec fn" is possible
>> (exec builtin is supposed to be possible now, as (almost) all builtins
>> are supposed to have exec*(2) versions somewhere in $PATH) is if at least
> 
> I repeat: the exec builtin does *not* have anything to do with
> requiring the C code of the shell (could be COBOL for all I know)
> to actually call an exec*(2) syscall.

Actually, we have word from Geoff Clare, who is authoritative on this
matter, that the intention of POSIX was to standardise the pre-existing
behaviour of ksh88.[*]

As both Geoff and I have verified with our own copies of ksh88 (mine on
a Solaris 10.3 VM), 'exec' on ksh88 always overlays the shell process
with an external command using an exec*(2) syscall. It never runs a
shell function or a builtin.

Another fact is that pdksh was intended to be a clone of ksh88. Thus,
pdksh failed to clone ksh88's 'exec' properly.

mksh, being a modified version of pdksh, inherited the problem.

Every other shell except zsh acts like ksh88. And the zsh devs just
fixed the problem for its POSIX mode the other day.

Since you appear to feel strongly about this, maybe a compromise would
be to make mksh act like ksh88 for POSIX mode only.

- M.

[*]
https://www.mail-archive.com/austin-group-l@opengroup.org/msg01440.html
| The intended behaviour is that of ksh88, since that was the shell the
| POSIX description was based on.  I checked ksh88 shells on Solaris 11
| and HP-UX 11.23 and they execute the utility, not the function. [...]
| [The] wording in the standard certainly does not match the intended
| behaviour and needs to be corrected.

https://www.mail-archive.com/austin-group-l@opengroup.org/msg01469.html
| The use of "program" and "overlaid the shell" here means that the
| standard clearly does not allow the execution of built-in utilities and
| functions.

Reply via email to