Re: .env file handling

2017-10-24 Thread Casper Ti. Vector
See also rc(1) :) On Tue, Oct 24, 2017 at 10:55:28PM +0200, Guillaume Perréal wrote: > The scoping might be a bit challenging, but the variable substitution system > is royal. I do not constantly ask myself "what will happen if this variable > contains a space, or a quote ?". -- My current

Re: .env file handling

2017-10-24 Thread Guillaume Perréal
Le 24/10/2017 à 08:28, Colin Booth a écrit : I would say that is one of the two difficulties. The other one being that execline also tries hard not to carry any overhead, which means that often times you can end up in situations where the aggressive scoping that it does makes things challenging

Re: .env file handling

2017-10-24 Thread Monty Zukowski
Thank you for the explanations and solutions, things are starting to make more sense now. I can live with the envdir approach for my docker containers, or provide a tool to parse .env files and create the envdir when loading in the settings but before launching a program. Thanks, Monty On

Re: .env file handling

2017-10-24 Thread Laurent Bercot
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} /path/to/xyz It's not as

Re: .env file handling

2017-10-23 Thread Colin Booth
On Tue, Oct 24, 2017 at 09:25:37AM +0800, Casper Ti. Vector wrote: > > #!/bin/sh > > exec env -i $(cat /path/to/xyz.env) /path/to/xyz > And of course you should be careful with the contents in `xyz.env'. > You can do the same with #!/bin/sh while read A ; do export "$A" done < "$1" exec