### Method

# Gio ApplicationCommandLine getenv

since: 2.28

#### Declaration [src]

    const gchar*
    g_application_command_line_getenv (
      GApplicationCommandLine* cmdline,
      const gchar* name
    )

#### Description [src]

Gets the value of a particular environment variable of the command line invocation, as would be returned by g_getenv(). The strings may contain non-utf8 data.

The remote application usually does not send an environment. Use `G_APPLICATION_SEND_ENVIRONMENT` to affect that. Even with this flag set it is possible that the environment is still not available (due to invocation messages from other applications).

The return value should not be modified or freed and is valid for as long as `cmdline` exists.

Available since: 2.28

#### Parameters

`name`

  Type: `const gchar*`

  The environment variable to get.

  The data is owned by the caller of the method.
  The value is a platform-native string, using the preferred OS encoding on Unix and UTF-8 on Windows.

#### Return value

Type: `const gchar*`

The value of the variable, or `NULL` if unset or unsent.

The returned data is owned by the instance.
The return value can be `NULL`.
The value is a NUL terminated UTF-8 string.