help-guix
[Top][All Lists]
Advanced

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

Re: bash scripts in Guix question


From: Maxim Cournoyer
Subject: Re: bash scripts in Guix question
Date: Wed, 05 Oct 2022 20:43:58 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.1 (gnu/linux)

Hi,

Olivier Dion <olivier.dion@polymtl.ca> writes:

[...]

>> I prefer the "#!/usr/bin/env bash" shebang; /usr/bin/env is available on
>> FHS distribution, and on Guix System, for convenience.  You can use if
>> for any interpreted script, such as Guile, Python, Perl, etc.
>
> Only if coreutils is in the profile that would work yes.

coreutils doesn't need to be in the profile since /usr/bin/env is linked
to (file-append coreutils "bin/env"); see in the value of %base-services
in (gnu services base), which contains:

--8<---------------cut here---------------start------------->8---
(service special-files-service-type
                 `(("/bin/sh" ,(file-append bash "/bin/sh"))
                   ("/usr/bin/env" ,(file-append coreutils "/bin/env"))))
--8<---------------cut here---------------end--------------->8---
                   

'env' looks up the command passed to it from PATH, but that's usually
satisfied if you were going to use a FHS location anyway such as
"/bin/bash".

-- 
Thanks,
Maxim



reply via email to

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