OxL Reference

fn setenv

Sets an environment variable of this process. Static configuration is not affected: it was loaded at startup (§14.1).

Example:

oxl✓ checked in CI
fn main() io {
  setenv("OXL_DOC_EXAMPLE", "yes")
  print("{env("OXL_DOC_EXAMPLE") ?? "unset"}")
}
Output
yes
@intrinsic("setenv") pub(api) fn setenv(name: str, value: str) io

Since. 1.0.0-beta

Parameters

NameType
namestr
valuestr

Effects

io

Defined in: std/core/functions.oxl:60

See also