Proposal: let execline's envfile do substitution

From: Paul Sopka <psopka_at_sopka.ch>
Date: Fri, 20 Sep 2024 12:38:12 +0200

Hey Laurent,

I wanted to ask whether variable substitution could be added to the
envfile program of execline.

As an example of the requested functionality:

example.conf

| ${A}=/home/${USER}/somewhere


examplescript

| #!/bin/execlineb
|
| define A x
| define USER y
|
| envfile example.conf
|
| printenv

should print x=/home/y/somewhere

Since I could not find any elegant and short way of implementing this in
execline
for a directory of .conf files.

One reason this can be useful is for config files of an instantiated
service that starts one svscan per user
to export global but configurable environment variables that are
required to be available to many user-services.
Examples of those are XDG_RUNTIME_DIR and DBUS_SESSION_BUS_ADDRESS.

Regards,

Paul

Received on Fri Sep 20 2024 - 12:38:12 CEST

This archive was generated by hypermail 2.4.0 : Fri Sep 20 2024 - 12:38:47 CEST