setShellEnvVar
setShellEnvVar(t_varName_or_nameValuePair[t_varValue] ) =>t/nil
Description
Sets or updates the value of the UNIX environment variable. This function expands the environment variable name specified in the argument.
Arguments
|
Environment variable name or assignment expression ( |
|
Value Returned
Examples
Sets the parent working directory to the /tmp directory.
setShellEnvVar("PWD=/tmp”)
=> t
Gets the parent working directory.
getShellEnvVar("PWD")
=> "/tmp"
Sets the Test directory to the /tmp directory.
setShellEnvVar("TEST=/tmp”)
=> t
Sets the Test directory to the home directory.
setShellEnvVar("TEST" "/home")
=> t
Returns nil, as an equal to sign is required to set the value.
setShellEnvVar("TEST")
=> nil
WARNING* setShellEnvVar: must have an equal sign to set a value - "TEST"
Returns nil, as the argument does not have a variable name.
setShellEnvVar("=/tmp")
=> nil
*WARNING* setShellEnvVar: the argument should include a variable name - "=/tmp"
Returns nil, as the argument has a space before the equal to sign.
setShellEnvVar("TEST = /tmp")
=> nil
*WARNING* setShellEnvVar: must not have a space before the equal sign - "TEST = /tmp
setShellEnvVar("ITER" "1")
=> t
setShellEnvVar("EDITOR_COPY_$ITER" "$EDITOR")
=> t
getShellEnvVar("EDITOR_COPY_$ITER")
=> "gedit"
Related Topics
Return to top