set variable

Set variables in the GFSH environment.

Set GFSH variables that can be used by commands.

You can use the 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. Name for the variable. Name must only be composed of letters, numbers and the “_” character and may not start with a number.
‑‑value Required. Value that the variable will be set to.

Table 1. Set Variable Parameters

Example Commands:

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

Sample Output:

gfsh>set variable --name=APP_COLLECTION_LIMIT --value=10
Value for variable APP_COLLECTION_LIMIT is now: 10.

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