s6-portable-utils
Software
skarnet.org
 The s6-dumpenv program 
 s6-dumpenv stores its environment variables into a directory.
 Interface 
     s6-dumpenv [ -N | -n ] [ -m mode ] dir
 -  s6-dumpenv creates the directory dir if it does not exist
yet. 
-  For every environment variable x with value y
that it has, it creates a file dir/x containing
y. 
-  It then exits 0. 
 Options 
 -  -N : chomp. Write the environment variables with an
extra newline at the end, so the environment can be retrieved via
s6-envdir -Lf dir. 
-  -n : Write the environment variables as is; the
environment will be retrieved via s6-envdir -Lfn dir.
This is the default. 
-  -m mode : create dir with
mode mode if it doesn't exist yet. Default is 0755. 
 Notes 
 -  A program prog can be run with the environment in dir
by using s6-envdir
-fn -- dir prog.