S6-ENVDIR(8)
π S6-ENVDIR(8) β like, the system manager's manual bestie, we're in the big leagues now
okay so picture this: you want to change your environment and then exec into another program, right? That's the whole gig. s6-envdir is the main character here, and she ate. π
β¨ SYNOPSIS β¨
s6-envdir [-I | -i] [-n] [-f] [-L] [-c nullis] dir prog...
literally just dir and then prog..., bestie. That's it. That's the whole vibe. π«Ά
πΈ DESCRIPTION πΈ
okay so here's what she does: s6-envdir reads the files inside dir. And for every file f in dir that does not begin with a dot and does not contain the = character, she's gonna do one of two things:
- If
fis empty? She removes a variable namedffrom the environment, if there even is one. Bye bestie. π - Otherwise? She adds a variable named
fto the environment (or replacesfif it's already lurking in there) and the value is the first line of the contents of filef. Spaces and tabs at the end of that line get yeeted, along with any trailing newline; and any null characters in that line get changed to newlines in the environment variable. slay. β¨
and ngl, the plot twist is: s6-envdir without any options behaves exactly like envdir[1]. same energy, fr fr. π
π OPTIONS π
-iβ Strict mode. Ifdirdoesn't exist, she exits111with an error message. This is the default, so like, that's the vibe you get for free. periodt.-Iβ Loose mode. Ifdirdoesn't exist, she just execs intoprogwithout touching the environment first. no notes, very chill of her. π¦-fβ Verbatim mode. The entire file becomes the value of the environment variable, newlines and all (except the last one, if you didn't pass-n). Null characters are still getting translated though β that part doesn't change. π₯-nβ Do not chomp. If-fis given and the file ends with a newline, that last newline stays in the value. If-fis not given, she keeps the trailing blanks at the end of the first line (but not the ending newline). so basically, no nibbling. π-Lβ Do not clamp. With this one,s6-envdirwill process the whole first line of each file (if-fhasn't been given) or read each file entirely (if-fhas been given) β even if it means adding huge variables to the environment. Without this option, she only reads the first4096bytes of each file. so like,-Lis the "no thoughts, full send" flag. π-cnullisβ Replace null characters with the first character ofnullisinstead of a newline. cute little custom substitution moment. π
β οΈ real talk: -L will genuinely let you stuff massive variables into your environment, and that's on purpose. She's not gonna stop you. Just know what you're asking for.
π¦ 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 β iykyk, go read the source of truth. π
π AUTHORS π
- Laurent Bercot
- Alexis <flexibeast@gmail.com> (man page port)
and that's the whole thing, bestie β no cap, every flag documented, every detail intact, iconic behavior only. πβ¨
Debian Β· March 13, 2022 Β· she's giving S6-ENVDIR(8) and she's serving it fr fr. ππΈπ
π¦ where this page comes from
- nixpkgs unstable: s6 2.15.1.0
- nixpkgs unstable: s6-man-pages 2.14.0.1.4
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms