Example: Get the names of all variables set in the environment

public static int main () {
// Local Output:
// ``SSH_AGENT_PID``
// ``PATH``
// ...
string[] args = Environment.list_variables ();
foreach (string arg in args) {
print ("%s\n", arg);
}
return 0;
}

 valac --pkg glib-2.0 GLib.Environment.list_variables.vala

See:




2022 vala-language.org