set environment (gdb mode only)

Set an environment variable to a value.

Syntax

set environment name [ value ]

Parameters

name

The name of an environment variable.

value

The value for the environment variable.

Description

This command sets an environment variable to a value you specify.

To show the value of an environment variable, use show environment.

To remove an environment variable, use unset environment.

The environment commands have no effect on the environment of any currently running process. The environment commands do not change or show the environment variables of the debugger or of the current process. They only affect the environment variables that will be used when a new process is created.

You can set and unset environment variables for processes created in the future to set up an environment different from the environment of the debugger and of the shell from which the debugger was invoked. When set, the environment variables apply to all new processes you debug.

Notice that a space delimits the name of the environment variable and its value. The debugger interprets an equal sign without a space as part of the value of the variable.

Example

The following example demonstrates that the a space delimits the name of the environment variable and its value. It also demonstrates that the command interprets an equal sign as part of variable's value.

(idb)  show environment FOO
Environment variable "FOO" not defined.
(idb)  set environment FOO = rabbit
set environment FOO = rabbit
                           ^
Unable to parse input as legal command or C expression.
(idb)  set environment FOO=rabbit
(idb)  show environment FOO
FOO==rabbit
(idb) set environment FOO rabbit
(idb) show environment FOO
FOO=rabbit
(idb) 

See Also


Submit feedback on this help topic

Copyright © 1996-2010, Intel Corporation. All rights reserved.