Hi Blake,

the*--id 1010* sets the user ID to to 1010 (the default is 1001).
The user ID is the first item in*⎕AI.*

I used *--id 1010* to test if multiple arguments on the shebang line
are parsed properly. Normally the shebang line has only one argument.
To have more than one argument you have to quote them and use the *-S*
option of *env* to split them again into multiple arguments.

GNU APL has a built-in split for that case and therefore no need to quote
multiple arguments on the shebang line.

Best Regards,
Jürgen


On 3/9/26 19:16, Blake McBride wrote:
Hello Dr. Sauermann,

I do not understand the "--id 1010" you are adding.

Blake

On Mon, Mar 9, 2026 at 12:42 PM Dr. Jürgen Sauermann <mail@jürgen-sauermann.de <mailto:mail@j%C3%BCrgen-sauermann.de>> wrote:

    Hi Blake,

    I see, thanks.

    However that method seems to have undesirable side effects.

    For example the *tty* of the shell that starts a script is messed up.
    And the interpreter ID is is not properly unregistered.

    My script is:
    *
    #!/usr/bin/env -S apl "--script --id 1010"

          ⊃⎕ARG      ⍝ show command line options
          )OFF      ⍝ leave the interpreter
    *
    and executing it twice gives:*
    *
    *eedjsa@server68:~/apl-1.9/workspaces$ ./SCRIPT.apl
    apl
    --script
    --id
    1010
    ./SCRIPT.apl

    eedjsa@server68:~/apl-1.9/workspaces$ ./SCRIPT.apl
    *** Another APL interpreter with --id 1010 is already running
    eedjsa@server68:~/apl-1.9/workspaces$ *

    Best regards,
    Jürgen


    On 3/9/26 11:41, Blake McBride wrote:
    Greetings,

    APL scripts start with:  #!/usr/local/bin/apl --script

    It is my understanding that that is not a portable way to start
    scripts.

    For maximum portability on a modern system, the following should
    be used instead:
    #!/usr/bin/env -S apl --script

    For maximum historical portability:
    #!/bin/sh
    exec apl --script "$0" "$@"


    Blake McBride


  • APL script sta... Blake McBride
    • Re: APL s... Dr . Jürgen Sauermann via Bugs and suggestions for GNU APL
      • Re: A... Blake McBride
        • R... Dr . Jürgen Sauermann via Bugs and suggestions for GNU APL
          • ... Dr . Jürgen Sauermann via Bugs and suggestions for GNU APL

Reply via email to