guile-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: feature request: simple hashbang for executable scripts


From: Matt Wette
Subject: Re: feature request: simple hashbang for executable scripts
Date: Thu, 24 Aug 2017 18:30:38 -0700

> 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$ 


reply via email to

[Prev in Thread] Current Thread [Next in Thread]