Example: List all environment variables

public static int main (string[] args) {
// Output:
// ``GJS_DEBUG_TOPICS=JS ERROR;JS LOG``
// ``G_BROKEN_FILENAMES=1``
// ...
string[] vars = Environ.get ();
foreach (unowned string str in vars) {
print ("%s\n", str);
}
return 0;
}

 valac --pkg glib-2.0 GLib.Environ.get.vala

See:




2022 vala-language.org