unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
From: "Ludovic Courtès" <ludo@gnu.org>
To: Simon Tournier <zimon.toutoune@gmail.com>
Cc: 61094-done@debbugs.gnu.org
Subject: bug#61094: [PATCH] doc: Document 'shebang' for 'guix shell'.
Date: Thu, 16 Mar 2023 12:21:59 +0100	[thread overview]
Message-ID: <87v8j1eyaw.fsf@gnu.org> (raw)
In-Reply-To: <20230127111237.2910126-1-zimon.toutoune@gmail.com> (Simon Tournier's message of "Fri, 27 Jan 2023 12:12:37 +0100")

[-- Attachment #1: Type: text/plain, Size: 218 bytes --]

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’.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: Type: text/x-patch, Size: 1100 bytes --]

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

      parent reply	other threads:[~2023-03-16 11:23 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-27 11:12 [bug#61094] [PATCH] doc: Document 'shebang' for 'guix shell' Simon Tournier
2023-02-03 22:54 ` Liliana Marie Prikler
2023-02-07 11:48   ` zimoun
2023-02-09 16:07     ` Morgan Smith
2023-03-16 11:09       ` Ludovic Courtès
2023-03-16 11:21 ` Ludovic Courtès [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://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87v8j1eyaw.fsf@gnu.org \
    --to=ludo@gnu.org \
    --cc=61094-done@debbugs.gnu.org \
    --cc=zimon.toutoune@gmail.com \
    /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.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

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).