This executes script with a given set of env cars, what I was talking about is replacing placeholders in config with values from env vars.
What would look in a shell like
tpl() {
eval “cat <<EOF
$(cat)
EOF”
}
tpl </etc/config.tpl >/etc/config
But safer 😊
From: Laurent Bercot
Sent: 16 October 2016 21:14
To: skaware_at_list.skarnet.org
Subject: Re[4]: How to write an execline helper in execline?
>Hi, slightly among the lines of this suggestion, is there anything to
>help templating files with a given set (or subset) of env vars? This
>would be nice addition for s6 overlay
I can't think of anything simpler than
s6-envdir dir_containing_all_variable_definitions
multisubstitute
{
import -u variable1
import -u variable2
import -u variable3
...
}
script_using_variables
Is that the kind of thing you're looking for?
--
Laurent
Received on Mon Oct 17 2016 - 06:50:10 UTC