Go to: Synopsis. Return value. Related. MEL examples.
getenv
string
getenv is NOT undoable, NOT queryable, and NOT editable.
The argument is the name of an environment variable. This command returns the value of that environment variable. If it doesn't exist, an empty string is returned.string | Environment variable value |
$s=`getenv "PATH"`; // Result: :/usr/sbin:/usr/bsd:/sbin:/usr/bin:/bin:/etc:/usr/etc // // Print all the folders of the plug-in path environment variable on separate lines. // They are separated by semi-colons on Windows, colons otherwise. { string $allparts[]; string $separator = ( `about -nt` ) ? ";" : ":"; tokenize( getenv("MAYA_PLUG_IN_PATH"), $separator, $allparts ); int $i; for ( $i=0; $i < size($allparts); $i++ ) { print( $i + " " + $allparts[ $i ] + "\n" ); } }