Main Help Page | Home Page (Internet) | Menus and Windows | Release Notes

Environment Variables

Zoom Shell allows you to set environment variables of two kinds. The first is the kind you might be used to -- shell variables which are passed on to any process started by Zoom Shell. The second is private variables, which are only used by the Zoom Shell command interpreter.

Please browse and run the files "variable_fun.zsh", "built_in_fun.zsh", and  "function_fun.zsh" in the samples directory to see how to set and manipulate variables.

Use

Environment variables are passed on to any process started by Zoom Shell. In addition, you may access the variables at the command prompt. Zoom Shell supports three syntaxes for variable substitution. The prefered method uses the dollar sign and squiggle bracket:

cd ${windir} (go to the Windows directory)

cd $windir (go to the Windows directory)

cd %windir% (go to the Windows directory)

net use ${logonserver}\shared (map a drive to the logonserver's "shared" drive)

Environment Editor

The central place for viewing or modifying environment variables is under the Environment tab in the Zoom Shell Help Desk, which has three fields.

The first is a read-only field that displays the variables already defined by the system and inherited by Zoom Shell, plus (Windows NT only) those variables which Zoom Shell itself defined and has already loaded.

The next displays environment variables which Zoom Shell will define when it starts up, and will pass on to other applications.

The third shows private environment variables, which Zoom Shell will use but not pass on to other applications.

System Variables

When Zoom Shell starts up it inherits the environment from whatever process starts it -- usually the Program Manager. It inherits the PATH, TEMP, TMP, plus several other variables. You can type the set command in a DOS window or in Zoom Shell to see what the system variables are. These variables are set when Windows first starts up.

Zoom Shell Environment Variables

When Zoom Shell starts it also reads a file called .profile in its home directory. That file contains any environment variables that you want to pass on to other applications, such as a modified path.

By default, the .profile file contains only one variable, ZSInherit. This variable is used when you start Zoom Shell within Zoom Shell. It tells any child Zoom Shell not to read the .profile file again. Future versions of Zoom Shell may use it for other purposes as well.

You may also use the setenv command to set a temporary environment variable. For example, the program ncftp requires a "home" environment variable:

Any varaibles set by the setenv command will go away when you close and re-start Zoom Shell.

Private Variables

You can set private variables at the command line, or by entering the variable in the environment editor.

  1. back=c:\backup
  2. docs=j:\some long name
  3. zip $back\$date "$docs"

The example above demonstrates a few important things. Directories with spaces in their names need to be enclosed in quotes, which is what is being done on line 3. Line 3 also demonstrates a built-in variable, the date variable.

Promoting Private Variables

You can make private variables available to other applications by using the export command:

  1. back=c:\backup
  2. export back

Built-in Variables

Here are the variables built into Zoom Shell:

  1. * -- the entire command line (the command that called the script when in a script; otherwise the current command line)
  2. ? -- the status of the last command (zero is successful)
  3. ! -- the PID of the last command
  4. 0 -- the command on the command line (see parameters) (the name of the script when in a script; otherwise the current command name)
  5. 1-9 -- the first through nineth parameters on the command line (the command line that invoked the script when in a script; otherwise the parameters in the current command line):
  6. cd, cwd, pwd -- current directory
  7. currentdrive -- current drive
  8. date -- current date in machine's default format
  9. dddd -- the long name of the day
  10. ddd -- the abbreviated day name
  11. dd -- the two digit day
  12. d -- the one digit day
  13. freespace{a-z} -- freespace on drive A-Z
  14. hh -- the current hour
  15. mi -- the current minute
  16. mmmm -- the long name of the month
  17. mmm -- the abbreviated month name
  18. mm -- the two digit month
  19. m -- the one or two digit month
  20. pop{1-4} -- the directory stored in the numbered popd history
  21. random -- a random number up to 32767
  22. ss -- the current second
  23. time -- current time in machine's default format
  24. yy -- the current year without century
  25. yyyy -- the current year with century

Table of Contents