Subject: Re: [PATCH] doc: Document 'shebang' for 'guix shell'.

From: Liliana Marie Prikler <[email-masked]>
Date: Fri, 03 Feb 2023 23:54:38 +0100

Am Freitag, dem 27.01.2023 um 12:12 +0100 schrieb Simon Tournier:
> * doc/guix.texi (Invoking guix shell): Add a note mentioning how to
> use
> 'shebang'.
> ---
>  doc/guix.texi | 15 ++++++++++++++-
>  1 file changed, 14 insertions(+), 1 deletion(-)
> 
> diff --git a/doc/guix.texi b/doc/guix.texi
> index 2b1ad77ba5..acda01c8e6 100644
> --- a/doc/guix.texi
> +++ b/doc/guix.texi
> @@ -71,7 +71,7 @@ Copyright @copyright{} 2019 Kyle Andrews@*
>  Copyright @copyright{} 2019 Alex Griffin@*
>  Copyright @copyright{} 2019, 2020, 2021, 2022 Guillaume Le
> Vaillant@*
>  Copyright @copyright{} 2020 Liliana Marie Prikler@*
> -Copyright @copyright{} 2019, 2020, 2021, 2022 Simon Tournier@*
> +Copyright @copyright{} 2019, 2020, 2021, 2022, 2023 Simon Tournier@*
>  Copyright @copyright{} 2020 Wiktor Żelazny@*
>  Copyright @copyright{} 2020 Damien Cassou@*
>  Copyright @copyright{} 2020 Jakub Kądziołka@*
> @@ -5923,6 +5923,19 @@ building or downloading any missing package,
> and runs the
>  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,
> +
> +@example
> +#!/usr/bin/env -S guix shell python python-nympy -- python3
> +@end example
> +
> +All the @var{options} or convenience of @command{guix shell} apply.
> +@end quotation
> +
Is this really guix running as a shell or is it actually a feature of
env?  In either case, it's worth documenting, but we should try to stay
factually correct.

Cheers