# Spawn a child with only the environment entries listed by this program.
start:
    let arguments: TextList = text_list()
    list_push(arguments, "%s\n")
    list_push(arguments, "Child started with an explicit environment.")

    let child_environment: TextList = text_list()
    list_push(child_environment, "PATH=/usr/bin:/bin")
    list_push(child_environment, "YAZA_CHILD_MODE=example")

    let status: Number = process_env("/usr/bin/printf", arguments, child_environment)
    if status != 0:
        say "Child process failed with status " + number_text(status)
