• exec under Unix/BSD/Linux

    From Roderick@21:1/5 to All on Wed May 4 10:24:35 2022
    I suppose, exec does not call a shell. Am I right?

    Thanks
    Rod.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Gerald Lester@21:1/5 to Roderick on Wed May 4 07:39:52 2022
    On 5/4/22 05:24, Roderick wrote:

    I suppose, exec does not call a shell. Am I right?

    Yes, that is correct -- exec does not "call" a shell, unless of course
    you exec "/bin/sh" or such.


    --
    +----------------------------------------------------------------------+
    | Gerald W. Lester, President, KNG Consulting LLC |
    | Email: Gerald.Lester@kng-consulting.net | +----------------------------------------------------------------------+

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Roderick@21:1/5 to Gerald Lester on Wed May 4 17:40:26 2022
    On Wed, 4 May 2022, Gerald Lester wrote:

    On 5/4/22 05:24, Roderick wrote:

    I suppose, exec does not call a shell. Am I right?

    Yes, that is correct -- exec does not "call" a shell, unless of course you exec "/bin/sh" or such.

    Thanks!

    You a right, "call" is not the rith expression, but "hand the
    argument to a command interpreter" like in "man sysem":

    "The system() function hands the argument string to the command
    interpreter sh(1). The calling process waits for the shell to finish
    executing the command, ignoring SIGINT and SIGQUIT, and blocking
    SIGCHLD."

    Rod.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Christian Gollwitzer@21:1/5 to All on Wed May 4 21:07:30 2022
    Am 04.05.22 um 19:40 schrieb Roderick:

    On Wed, 4 May 2022, Gerald Lester wrote:

    On 5/4/22 05:24, Roderick wrote:

    I suppose, exec does not call a shell. Am I right?

    Yes, that is correct -- exec does not "call" a shell, unless of course
    you exec "/bin/sh" or such.

    Thanks!

    You a right, "call" is not the rith expression, but "hand the
    argument to a command interpreter" like in "man sysem":

         "The system() function hands the argument string to the command
         interpreter sh(1).  The calling process waits for the shell to finish
         executing the command, ignoring SIGINT and SIGQUIT, and blocking
         SIGCHLD."

    Still this is true - exec in Tcl does not start /bin/sh or the like.
    Instead, it uses the exec syscall to execute the commands given and
    parses the arguments etc. itself in order to mimic the shell and handle redirections for stderr , pipes etc. That is also why the syntax for redirections is slightly different from the shell etc.

    Christian

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)