I tried rewriting the whole thing in execline and while I'm pretty sure
it's doable it's not easy.

 A direct translation of Casper's script to execline could be:

#!/command/execlineb -P
backtick LIST { cat /path/to/xyz.env }
importas -nsd"\n" LIST LIST
env -i ${LIST}

 It's not as idiomatic as other ways to handle variables in execline,
but it should work.

 The underlying difficulty with Monty's question is that execline tries
to avoid parsing as much as possible, and a file full of key=value lines,
as simple as it is, still requires some parsing. execline wasn't made
for this; the idiomatic way to store key-value pairs in the filesystem
for use by an execline script is, as Monty found out, s6-envdir.
If you really want a shell-like syntax, the best way to handle it is
with tools that already understand this syntax, such as a shell, or as
Casper suggested, env.


Reply via email to