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