set variable

Set variables in the gfsh environment.

Set gfsh variables that can be used by commands.

You can use the gfsh echo command to view the value of a variable. For example, to see a list of all environment variables and their current values, use the following command:

gfsh>echo --string=$*

See Useful gfsh Shell Variables for a description of preset environment variables.

Availability: Online or offline.


set variable --name=value --value=value

Name Description
‑‑name Required. The name to be assigned for the variable. The name must only be composed of letters, digits, and the underscore character (_); the name may not start with a digit.
‑‑value Required. Value that the variable will be set to.

Example Commands:

set variable --name=FOO --value="foo"
set variable --name=BAR --value="bar"

Sample Output:

gfsh>set variable --name=BAR --value="bar"
Value for variable BAR is now: "bar".