s6-envdir.html (3010B)
1 <html> 2 <head> 3 <meta name="viewport" content="width=device-width, initial-scale=1.0" /> 4 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> 5 <meta http-equiv="Content-Language" content="en" /> 6 <title>s6: the s6-envdir program</title> 7 <meta name="Description" content="s6: the s6-envdir program" /> 8 <meta name="Keywords" content="s6 command s6-envdir dir environment modification" /> 9 <!-- <link rel="stylesheet" type="text/css" href="//skarnet.org/default.css" /> --> 10 </head> 11 <body> 12 13 <p> 14 <a href="index.html">s6</a><br /> 15 <a href="//skarnet.org/software/">Software</a><br /> 16 <a href="//skarnet.org/">skarnet.org</a> 17 </p> 18 19 <h1> The s6-envdir program </h1> 20 21 <p> 22 s6-envdir changes its environment, then executes into another program. 23 </p> 24 25 <h2> Interface </h2> 26 27 <pre> 28 s6-envdir [ -I | -i ] [ -n ] [ -f ] [ -L ] [ -c <em>nullis</em> ] <em>dir</em> <em>prog...</em> 29 </pre> 30 31 <ul> 32 <li> s6-envdir reads files in <em>dir</em>. For every file <em>f</em> in <em>dir</em>, 33 that does not begin with a dot and does not contain the '=' character: </li> 34 <li> If <em>f</em> is empty, remove a variable named <em>f</em> from the environment, if any. </li> 35 <li> Else add a variable named <em>f</em> to the environment (or replace <em>f</em> if it 36 already exists) with the first line of the contents of file <em>f</em> as value. 37 Spaces and tabs at the end of this line are removed, as well as any trailing newline; 38 null characters in this line are changed to newlines in the environment variable. </li> 39 </ul> 40 41 <h2> Options </h2> 42 43 <ul> 44 <li> <tt>-i</tt> : strict. If <em>dir</em> does not exist, exit 111 with an 45 error message. This is the default. </li> 46 <li> <tt>-I</tt> : loose. If <em>dir</em> does not exist, exec into 47 <em>prog</em> without modifying the environment first. </li> 48 <li> <tt>-f</tt> : verbatim mode. All the file is given as the value of the 49 environment variable, including newlines (except the last one if the <tt>-n</tt> 50 option is not given). Null characters are still translated. </li> 51 <li> <tt>-n</tt> : do not chomp. If the <tt>-f</tt> option is given and the 52 file ends with a newline, keep that last newline in the value. If the <tt>-f</tt> 53 option is not given, keep the trailing blanks at the end of the first line (but 54 not the ending newline). </li> 55 <li> <tt>-L</tt> : do not clamp. With this option, s6-envdir will process 56 the whole first line of each file (if the <tt>-f</tt> option hasn't been given) 57 or read each file entirely (if the <tt>-f</tt> option has been given), even if 58 it means adding huge variables to the environment. Without this option, s6-envdir 59 only reads the first 4096 bytes of each file. </li> 60 <li> <tt>-c</tt> <em>nullis</em> : replace null characters with the 61 first character of <em>nullis</em> instead of a newline. </li> 62 </ul> 63 64 <h2> Notes </h2> 65 66 <p> 67 s6-envdir without options behaves exactly like 68 <a href="https://cr.yp.to/daemontools/envdir.html">envdir</a>. 69 </p> 70 71 </body> 72 </html>