unofficial mirror of help-guix@gnu.org 
 help / color / mirror / Atom feed
From: Guillaume Le Vaillant <glv@posteo.net>
To: "André A. Gomes" <andremegafone@gmail.com>
Cc: mail@ambrevar.xyz, help-guix@gnu.org
Subject: Re: SBCL's run-program and environment variables
Date: Wed, 01 Sep 2021 07:32:53 +0000	[thread overview]
Message-ID: <87bl5cagnh.fsf@kitej> (raw)
In-Reply-To: <87o89dh1e7.fsf@gmail.com>

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

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 #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 247 bytes --]

  reply	other threads:[~2021-09-01  7:40 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-31 19:14 SBCL's run-program and environment variables André A. Gomes
2021-09-01  7:32 ` Guillaume Le Vaillant [this message]
2021-09-01 11:39   ` André A. Gomes

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=87bl5cagnh.fsf@kitej \
    --to=glv@posteo.net \
    --cc=andremegafone@gmail.com \
    --cc=help-guix@gnu.org \
    --cc=mail@ambrevar.xyz \
    /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.
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).