Skip to main content

Useful gfsh Shell Variables

You can use the built-in gfsh shell variables in scripts.

You can also use the set variable command to modify shell behavior or to define your own variables.

To see a list of all gfsh shell variables and their current values, use the following command:

gfsh>echo --string=$*

To obtain the current value of an existing variable, use the following command syntax (the variable must be enclosed in braces):

gfsh>echo --string=${VARIABLE}

For example:

gfsh>echo --string=${SYS_CLASSPATH}

System Variables

SYS_CLASSPATHCLASSPATH of the gfsh JVM (read only).
SYS_GEMFIRE_DIRProduct directory where Geode has been installed (read only).
SYS_HOST_NAMEHost from which gfsh is started (read only).
SYS_JAVA_VERSIONJava version used (read only).
SYS_OSOS name (read only).
SYS_OS_LINE_SEPARATORLine separator (\ or ^) variable that you can use when writing gfsh scripts. (read only).
SYS_USERUser name (read only).
SYS_USER_HOMEUser's home directory (read only).

GFSH Environment Variables

APP_FETCH_SIZEFetch size to be used while querying. Values: 0 - 2147483647. Default value is 100.
APP_LAST_EXIT_STATUSLast command exit status. Similar to $? (Unix) and %errorlevel% (Windows). Values: 0 (successful), 1 (error), 2(crash) (read only).
APP_LOGGING_ENABLEDWhether gfsh logging is enabled. Default: false (read only). You can enable gfsh logging by setting the gfsh.log-level Java system property to a supported Java log level.
APP_LOG_FILEPath and name of current gfsh log file (read only).
APP_NAMEName of the application-- "gfsh" (read only).
APP_PWDCurrent working directory where gfsh was launched (read only).
APP_QUERY_RESULTS_DISPLAY_MODEToggle the display mode for returning query results. Values: table or catalog. Default value is table.
APP_QUIET_EXECUTIONWhether the execution should be in quiet mode. Values (case insensitive): true, false. Default value is false.
APP_RESULT_VIEWERUnix only. Set this variable to external to enable viewing of the output using the UNIX less command. Default value is basic (gfsh).