Re: 'exec' runs shell functions and builtins

2017-08-08 Thread Martijn Dekker
Op 08-08-17 om 00:49 schreef Thorsten Glaser: > I completely disagree, especially when combined with other wording. Well, Geoff Clare did say the existing wording is broken in any case. If the goal is compatibility with pre-existing practice (in this case, ksh88) and the majority of other shells

Re: 'exec' runs shell functions and builtins

2017-08-07 Thread Thorsten Glaser
Robert Elz dixit: >there is no right answer - and that the only rational result is that portable >scripts cannot expect to be able to exec a function (or any builtin that is Yes, but the others in this thread want to allow portable scripts to rely on the exec builtin always resulting in a PATH

Re: 'exec' runs shell functions and builtins

2017-08-04 Thread Thorsten Glaser
Martijn Dekker dixit: >> And this is utter nonsense, the builtin does replace the shell process, > >No. On mksh, 'exec builtin' is exactly equivalent to 'builtin; exit'. >The builtin is run in the existing shell process. No >replacing/overlaying of the shell process takes place. It's easy to

Re: 'exec' runs shell functions and builtins

2017-08-04 Thread Joerg Schilling
Martijn Dekker wrote: > 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

Re: 'exec' runs shell functions and builtins

2017-08-03 Thread Martijn Dekker
Op 26-07-17 om 00:41 schreef Thorsten Glaser: > Martijn Dekker dixit: > >> This behaviour also appears to be contrary to the documentation in >> mksh(1) ("The command is executed without forking, replacing the shell >> process"). The test script below demonstrates that neither "exec" > > And

Re: 'exec' runs shell functions and builtins

2017-07-26 Thread Joerg Schilling
Thorsten Glaser wrote: > Whether ?echo? is a builtin or not is an implementation detail. > Heck, things like ?true?, ?false?, ? are (and others can be) > implemented in some operating systems by symlinking them to the > shell executable (either ksh93 *or* mksh? not even

Re: 'exec' runs shell functions and builtins

2017-07-25 Thread Thorsten Glaser
Robert Elz dixit: > | This specifically means that builtins MAY be made available > | to exec, and that thatbs an expected modus operandi. > >It means nothing of the kind. The System Interfaces volume of POSIX.1-2008 >is the part that defines the system calls. There’s no “exec” system

Re: 'exec' runs shell functions and builtins

2017-07-25 Thread Thorsten Glaser
Martijn Dekker dixit: >And under what theory should 'exec' run a shell function? Read up on what a “command” can be, pretty far up in the Shell part. Although I did not manage to get a pipeline or loop run. Not sure if that’s a bug, but looking at the way statements are parsed, probably not.

Re: 'exec' runs shell functions and builtins

2017-07-25 Thread Martijn Dekker
Op 25-07-17 om 23:41 schreef Thorsten Glaser: > Martijn Dekker dixit: > >> This behaviour also appears to be contrary to the documentation in >> mksh(1) ("The command is executed without forking, replacing the shell >> process"). The test script below demonstrates that neither "exec" > > And

Re: 'exec' runs shell functions and builtins

2017-07-25 Thread Thorsten Glaser
Martijn Dekker dixit: >to be a bug in POSIX terms; 'exec' is supposed to launch a program that >overlays the current shell[2], implying the program launched by 'exec' >is always external to the shell. The built-in utility is “the program implementing command”, and, with exec, it is not returning

Re: 'exec' runs shell functions and builtins

2017-07-25 Thread Thorsten Glaser
Martijn Dekker dixit: >This behaviour also appears to be contrary to the documentation in >mksh(1) ("The command is executed without forking, replacing the shell >process"). The test script below demonstrates that neither "exec" And this is utter nonsense, the builtin does replace the shell