help-guix
[Top][All Lists]
Advanced

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

Re: SBCL's run-program and environment variables


From: Guillaume Le Vaillant
Subject: Re: SBCL's run-program and environment variables
Date: Wed, 01 Sep 2021 07:32:53 +0000

André A. Gomes <andremegafone@gmail.com> skribis:

> Hi Guix,
>
> Today I had the following issue and I'm wondering if other Guix users
> have this problem too.
>
> Start a SBCL REPL and run:
>
> --8<---------------cut here---------------start------------->8---
> (run-program "ls" '("-la")
>              :search "/run/current-system/profile/bin"
>              :environment '("TIME_STYLE=full-iso")
>              :output *standard-output*)
> --8<---------------cut here---------------end--------------->8---
>
>
> This fails on my side, but I was told it works on other GNU/Linux
> distros.  Can you reproduce it?
>
> I find this quite strange since the following Bash works for me:
>
> --8<---------------cut here---------------start------------->8---
> TIME_STYLE=full-iso /run/current-system/profile/bin/ls -la
> --8<---------------cut here---------------end--------------->8---
>
> Thank you.

Hi,

The documentation of the 'run-program' function indicates:

--8<---------------cut here---------------start------------->8---
:SEARCH
   Look for PROGRAM in each of the directories in the child's $PATH
   environment variable.  Otherwise an absolute pathname is required.
--8<---------------cut here---------------end--------------->8---

which means that it should be used either like this:

--8<---------------cut here---------------start------------->8---
(run-program "ls" '("-la")
             :search t
             :environment '("TIME_STYLE=full-iso"
                            "PATH=/run/current-system/profile/bin")
             :output *standard-output*)
--8<---------------cut here---------------end--------------->8---

or like this:

--8<---------------cut here---------------start------------->8---
(run-program "/run/current-system/profile/bin/ls" '("-la")
             :environment '("TIME_STYLE=full-iso")
             :output *standard-output*)
--8<---------------cut here---------------end--------------->8---

Attachment: signature.asc
Description: PGP signature


reply via email to

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