[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#61094: [PATCH] doc: Document 'shebang' for 'guix shell'.
From: |
Ludovic Courtès |
Subject: |
bug#61094: [PATCH] doc: Document 'shebang' for 'guix shell'. |
Date: |
Thu, 16 Mar 2023 12:21:59 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux) |
Hi Simon,
Simon Tournier <zimon.toutoune@gmail.com> skribis:
> * doc/guix.texi (Invoking guix shell): Add a note mentioning how to use
> 'shebang'.
Applied with the changes below.
Thanks!
Ludo’.
diff --git a/doc/guix.texi b/doc/guix.texi
index 9c1fc04265..aa98d7df4b 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -5940,16 +5940,19 @@ guix shell python python-numpy -- python3
@end example
@quotation Note
-@cindex shebang
-@command{guix shell} can be used as @emph{shebang}. Consider the
-previous example as an executable Python script, the @emph{shebang}
-reads,
+@cindex shebang, for @command{guix shell}
+@command{guix shell} can be also be used as a script interpreter, also
+known as @dfn{shebang}. Here is an example self-contained Python script
+making use of this feature:
@example
-#!/usr/bin/env -S guix shell python python-nympy -- python3
+#!/usr/bin/env -S guix shell python python-numpy -- python3
+import numpy
+print("This is numpy", numpy.version.version)
@end example
-All the @var{options} or convenience of @command{guix shell} apply.
+You may pass any @command{guix shell} option, but there's one caveat:
+the Linux kernel has a limit of 127 bytes on shebang length.
@end quotation
Development environments can be created as in the example below, which
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- bug#61094: [PATCH] doc: Document 'shebang' for 'guix shell'.,
Ludovic Courtès <=