LIBAST(3)
welcome to LIBAST(3) from the Library Functions Manual shelf, bestie π«Ά this page is all about environment-variable business and it's lowkey iconic.
πΈ NAME πΈ
setenviron - set environment value π
β¨ SYNOPSIS β¨
#include <ast.h>
char* setenviron(const char* key);
π¦ DESCRIPTION π¦
okay so setenviron controls environment name=value pairs. It's giving environment-variable management, but make it cute π
setenviron("name=value")β addsnameto the environment and returns a pointer to astrdup(3)copy ofname=value. yes, a whole duplicate, slay β¨setenviron("name")β removesnamefrom the environment and returns the empty string. poof, gone, no cap π¨setenviron(0)β reserves a few slots in an internal array, and it's usually called by a parent process that expects many children. big parent-energy moment π0β returned on error. not the vibe, but we respect the truth π
Also, setenviron preserves the ksh(1) convention of _ as the first environment variable name. shell heirloom behavior, iykyk π
π SEE ALSO π
Also see env(1) and exec(2) β go peek, bestie π
π BUGS π
bug alert, bestie π¨
POSIX will eventually settle on an interface. It has already picked a few of the names we did in .2 drafts. This is about the third name change for ours. literally naming drama π
Signed, sealed, and sparkling by LIBAST(3) β source/version mentioned in the footer, and the date is not shown there, so consider this your cute timestamp placeholder ππ bye bestie, go forth and set those environment variables β¨
π¦ where this page comes from
- opensuse-leap 16.0: ksh-devel 93vu-bp160.1.33 Β· CPL-1.0
- opensuse-leap 16.0: ksh-devel 93vu-bp160.1.33 Β· CPL-1.0
- opensuse-leap 16.0: ksh-devel 93vu-bp160.1.33 Β· CPL-1.0
- opensuse-leap 16.0: ksh-devel 93vu-bp160.1.33 Β· CPL-1.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms