From: Matt Wette <matt.wette@gmail.com>
To: guile-devel <guile-devel@gnu.org>
Subject: Re: feature request: simple hashbang for executable scripts
Date: Thu, 24 Aug 2017 18:30:38 -0700 [thread overview]
Message-ID: <253145A4-5D7D-433F-98BE-6B4187FAB7C9@gmail.com> (raw)
In-Reply-To: <87pobmomb5.fsf@netris.org>
> 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.
I hadn't thought of this. Pretty cool.
mwette$ cat zzz
#!/bin/sh
echo "hello from shell"
export FOO="custom"
exec guile -s $0
!#
(display "hello from guile\n")
(display "FOO: ")
(display (getenv "FOO"))
(newline)
mwette$ ./zzz
hello from shell
;;; note: source file /private/tmp/./zzz
;;; newer than compiled /Users/mwette/.cache/guile/ccache/2.2-LE-8-3.9/private/tmp/zzz.go
;;; note: auto-compilation is enabled, set GUILE_AUTO_COMPILE=0
;;; or pass the --no-auto-compile argument to disable.
;;; compiling /private/tmp/./zzz
;;; compiled /Users/mwette/.cache/guile/ccache/2.2-LE-8-3.9/private/tmp/zzz.go
hello from guile
FOO: custom
mwette$
prev parent reply other threads:[~2017-08-25 1:30 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-08-19 9:00 feature request: simple hashbang for executable scripts j kalbhenn
2017-08-21 7:04 ` Chaos Eternal
2017-08-21 9:21 ` j
2017-08-23 6:00 ` Mark H Weaver
2017-08-25 1:30 ` Matt Wette [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/guile/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=253145A4-5D7D-433F-98BE-6B4187FAB7C9@gmail.com \
--to=matt.wette@gmail.com \
--cc=guile-devel@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).