coreutils
[Top][All Lists]
Advanced

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

Re: [PATCH] env: new option '-f/--file' to load variables from file


From: Pádraig Brady
Subject: Re: [PATCH] env: new option '-f/--file' to load variables from file
Date: Sat, 9 Oct 2021 03:48:28 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:84.0) Gecko/20100101 Thunderbird/84.0

On 08/10/2021 20:32, mdeclerk wrote:
Add support to load variables from file using '-f/--file' option.
Each line must match the pattern 'NAME=VALUE'. Empty lines and
comments are ignored; comments start with '#' or whitepsaces
followed by '#'. Values refering to one or more other variables
indicated by a leading '$' (i.e., NEW_PATH=$PATH1:$PATH2:/my/path)
are resolved with respect to the original environment. Unknown
references are replaced with an empty string. This feature is
intended to work in tandem with the '-i' option to setup a fresh
envrionment plus the ability to import variables from the
original environment as needed. Variables with the same name
specified via command line override variables defined in the file.

This does seem useful.

I see some overlap in functionality
with the ENVIRON_FILE directive in login.defs(5)

I'll look into this a bit more.

thanks,
Pádraig



reply via email to

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