Hi,

Ricado proposed a new and better solution already. Nevertheless I want to comment on this proposal, sint it includes a pitfall and would not work:

Am 03.11.2017 um 22:17 schrieb Ricardo Wurmus:
exec /home/rekado/.guix-profile/bin/python <(/run/current-system/profile/bin/tail -n +4 "$0")
[...]
This seems to work just fine and off the top of my head I can’t think of
a situation where this would fail — unless the wrapped script performed
the same kind of trick of reading its contents through $0.  (How likely
is that?)

Indeed for Python programs it is quite common to revert to the filename using the variable "__file__". And if feeding in the script from stdin would set __file__ to "<stdin>". Using __file__ is more often used in package modules than in scripts (which could use $0 (sys.argv[0]). Anyway this is a pitfall we should avoid.

Please not that Ricardo's new solution, based on guile and execl does not suffer from this problem (I verified).
-- 
Regards
Hartmut Goebel

| Hartmut Goebel          | h.goebel@crazy-compilers.com               |
| www.crazy-compilers.com | compilers which you thought are impossible |