[GAP Forum] Gap doesn't quit automatically when running in script mode.
Hongyi Zhao
hongyi.zhao at gmail.com
Sat Apr 30 14:21:54 BST 2022
On Sat, Apr 30, 2022 at 9:00 PM Hongyi Zhao <hongyi.zhao at gmail.com> wrote:
>
> On Sat, Apr 30, 2022 at 6:58 PM Max Horn <horn at mathematik.uni-kl.de> wrote:
> >
> > Hi Hongyi,
> >
> > you need to use
> >
> > QUIT;
>
> Nice. It does the trick. But why must it be used like this?
>
> > instead of "quit".
> >
> > However, the result can still hang if there is an error in the script. To prevent this, I strongly recommend to pass the --quitonbreak to gap when using it non-interactively:
> >
> > gap --quitonbreak myscript.g
>
> Thank you for your tip. Based on the notes here [1-2], I adopted the
> following shebang line:
>
> #!/usr/bin/env -S gap --quitonbreak
>
> And then test it as follows:
>
> $ chmod +x abstract-group-irrep.gap
> $ ./abstract-group-irrep.gap
I was in such a hurry that I forgot to add the links quoted above.
Here they are:
[1] https://unix.stackexchange.com/questions/399690/multiple-arguments-in-shebang
[2] https://jhermann.github.io/blog/linux/know-how/2020/02/28/env_with_arguments.html
>
> > Cheers
> > Max
>
> Yours sincerely,
> Hongyi
More information about the Forum
mailing list