[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: feature request: simple hashbang for executable scripts
From: |
Mark H Weaver |
Subject: |
Re: feature request: simple hashbang for executable scripts |
Date: |
Wed, 23 Aug 2017 02:00:46 -0400 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/25.2 (gnu/linux) |
j kalbhenn <address@hidden> writes:
> scripts of other languages usually need just one line to specify the
> interpreter:
>
> #!/usr/bin/myinterpreter
>
> but with guile we have to add a final !#
>
> #!/usr/bin/guile !#
The shebang above does not work, because the "!#" is interpreted by the
kernel as an argument to pass to Guile before the script file name, and
then Guile interprets it as a file to load. Unless "!#" is a file in
the current directory, this will fail, or at least it does for me.
> or even
>
> #!/usr/bin/guile -s
> !#
>
> in my opinion, this is not ideal. from my perspective as a guile user
> this seems to be unnecessarily inconsistent and complicated.
There are advantages to the current approach, but regardless of what our
opinions might be about this, I don't see how we could change this now
without breaking a great many Guile scripts. Since the earliest days of
Guile, "#!" has been comment syntax that terminates with "!#", and many
Guile scripts depend on this.
For example, it is quite common to put a shell script between #! and !#
that ends by running Guile on the same file. It is also quite common to
put "-*- scheme -*-" on the second line to that Emacs will recognize the
type of the file.
Mark