-
-
Notifications
You must be signed in to change notification settings - Fork 13
Open
Description
E.g. if I have the following script to print out some variables:
#!/bin/bash
echo "PATH: $PATH"
echo "LD_LIBRARY_PATH: $LD_LIBRARY_PATH"
Then at the REPL:
;; Control to show defaults.
JIX> (external-program:run "./test.sh" nil :output t)
PATH: /home/john/.pyenv/shims:/home/john/.pyenv/bin:/home/john/.cargo/bin:/home/john/src/gitlab.com/johngavingraham/util/bin:/home/john/.local/bin:/home/john/bin:/home/john/.nix-profile/bin:/nix/var/nix/profiles/default/bin:/usr/lib64/ccache:/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/var/lib/snapd/snap/bin
LD_LIBRARY_PATH:
:EXITED
0
;; PATH is not picked up, but LD_LIBRARY_PATH is.
JIX> (external-program:run "./test.sh" nil :output t :environment '(("PATH" . "foo") ("LD_LIBRARY_PATH" . "bar")))
PATH: /home/john/.pyenv/shims:/home/john/.pyenv/bin:/home/john/.cargo/bin:/home/john/src/gitlab.com/johngavingraham/util/bin:/home/john/.local/bin:/home/john/bin:/home/john/.nix-profile/bin:/nix/var/nix/profiles/default/bin:/usr/lib64/ccache:/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/var/lib/snapd/snap/bin
LD_LIBRARY_PATH: bar
:EXITED
0
;; Attempting to replace the environment, PATH is simply cleared.
JIX> (external-program:run "./test.sh" nil :output t :environment '(("PATH" . "foo") ("LD_LIBRARY_PATH" . "bar")) :replace-environment-p t)
PATH:
LD_LIBRARY_PATH: bar
:EXITED
0
Metadata
Metadata
Assignees
Labels
No labels