Skip to content

env: add --env0-from option - #14626

Open
krosci wants to merge 3 commits into
uutils:mainfrom
krosci:env0-from
Open

krosci wants to merge 3 commits into
uutils:mainfrom
krosci:env0-from

Conversation

@krosci

@krosci krosci commented Sep 16, 2026

Copy link
Copy Markdown

Add the --env0-from=FILE option from GNU coreutils 9.12. It reads NUL-terminated name=value entries from FILE (or standard input when FILE is -) and applies them to the environment.

With --ignore-environment the file entries become the environment itself, preserving order, duplicates and entries without a = byte, so env -i --env0-from=f --null round-trips exactly and the entries reach the exec'd command untouched. Without -i the entries are merged into the inherited environment, with name=value entries overriding existing variables and entries without = appended verbatim. Multiple --env0-from files are processed in the order given.

Closes #14602

@krosci

krosci commented Sep 16, 2026

Copy link
Copy Markdown
Author

@cakebaker could you take a look at it? Thanks!

@github-actions

Copy link
Copy Markdown

GNU testsuite comparison:

Skip an intermittent issue tests/tail/tail-n0f (fails in this run but passes in the 'main' branch)
Note: The gnu test tests/dd/no-allocate is now being skipped but was previously passing.
Note: The gnu test tests/seq/seq-epipe is now being skipped but was previously passing.
Skip an intermittent issue tests/cut/bounded-memory (was skipped on 'main', now failing)
Skip an intermittent issue tests/pr/bounded-memory (was skipped on 'main', now failing)

@sylvestre

Copy link
Copy Markdown
Contributor

The ci is red!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: add --env0-from option to env

2 participants