guix-devel
[Top][All Lists]
Advanced

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

Re: Unable to define shebang for guix shell file


From: Ludovic Courtès
Subject: Re: Unable to define shebang for guix shell file
Date: Wed, 17 Nov 2021 11:51:00 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux)

Hi,

Jacob Hrbek <kreyren@rixotstudio.cz> skribis:

> Doesn't seem to work on `busybox sh` for me (I am not aware of better way to 
> replicate POSIX environment on GNU Guix):

Note that you’re running /usr/bin/env, which has nothing to do with
Busybox.

> kreyren@leonid ~$ guix shell busybox -- busybox sh
> ...
> ~ $ cat test.sh 
>
> #!/usr/bin/env -S guix shell --
> (use-modules
>       (guix channels))
>
> (list (channel
>         (name 'guix)
>         (url "https://git.savannah.gnu.org/git/guix.git";)
>         (commit
>           "f1bfd9f1948a5ff336d737c0614b9a30c2bb3097")
>         (introduction
>           (make-channel-introduction
>             "9edb3f66fd807b096b48283debdcddccfea34bad"
>             (openpgp-fingerprint
>               "BBB0 2DDF 2CEA F6A8 0D1D  E643 A2A0 6DF2 A33A 54FA")))))
>
> (specifications->manifest
>       (list "emacs@27.2"
>               "emacs-treemacs"
>               "emacs-evil"))
> ~ $ ./test.sh 
>
> guix shell: warning: no packages specified; creating an empty environment
> guix shell: warning: no packages specified; creating an empty environment

It’s working as expected: ‘guix shell’ has zero arguments so it creates
an empty environment.  Additionally, the shebang does not specify an
interpreter.

The example I gave at <https://issues.guix.gnu.org/50960#22> goes like
this:

--8<---------------cut here---------------start------------->8---
$ cat t.sh
#!/usr/bin/env -S guix shell hello bash -- sh
type -P hello
hello
--8<---------------cut here---------------end--------------->8---

HTH!

Ludo’.



reply via email to

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