S6-ENVDIR(8)

NAME
s6-envdir - change environment, then execute into another program

SYNOPSIS
s6-envdir [-I | -i] [-n] [-f] [-L] [-c nullis] dir prog...

DESCRIPTION
s6-envdir reads files in dir. For every file f in dir, that does not begin with a dot and does not contain the ‘=’ character:

•   If f is empty, remove a variable named f from the environment, if any.

•   Else add a variable named f to the environment (or replace f if it already exists) with the first line of the contents of file f as value. Spaces and tabs at the end of this line are removed, as well as any trailing newline; null characters in this line are changed to newlines in the environment variable.

s6-envdir without options behaves exactly like envdir[1].

OPTIONS

-i  Strict. If dir does not exist, exit 111 with an error message. This is the default.

-I  Loose. If dir does not exist, exec into prog without modifying the environment first.

-f  Verbatim mode. All the file is given as the value of the environment variable, including newlines (except the last one if the -n option is not given). Null characters are still translated.

-n  Do not chomp. If the -f option is given and the file ends with a newline, keep that last newline in the value. If the -f option is not given, keep the trailing blanks at the end of the first line (but not the ending newline).

-L  Do not clamp. With this option, s6-envdir will process the whole first line of each file (if the -f option hasn't been given) or read each file entirely (if the -f option has been given), even if it means adding huge variables to the environment. Without this option, s6-envdir only reads the first 4096 bytes of each file.

-c nullis
    Replace null characters with the first character of nullis instead of a newline.

SEE ALSO
s6-applyuidgid(8), s6-envuidgid(8), s6-fghack(8), s6-setsid(8), s6-setuidgid(8), s6-softlimit(8), s6-tai64n(8), s6-tai64nlocal(8)

[1] https://cr.yp.to/daemontools/envdir.html

This man page is ported from the authoritative documentation at: https://skarnet.org/software/s6/s6-envdir.html

AUTHORS
Laurent Bercot Alexis <flexibeast@gmail.com> (man page port)