SYNOPSIS
export NAME=value
set NAME=value
echo $NAME
DESCRIPTION
When a process is executed, it inherits a set of strings called the environment. It is conventional for these strings to have the form:
NAME=value
The export command built into the MKS KornShell can be used to set the variable NAME into the environment of every child process. The set command built into cmd.exe does the same. The echo command prints the value of environment variable NAME inside the MKS KornShell.
- Note:
-
The shell maintains additional shell variables that are not exported to child processes; because these variables are not passed on, they are not environment variables.
The following environment variables are used throughout MKS Toolkit:
- COLUMNS
-
If you set this variable to a numeric value, various commands use its value as the width of the output device in columns. This overrides the default.
- COMSPEC
-
The value of this variable must point to the standard command interpreter (cmd.exe), if you want to use that command interpreter in any way. This variable is called ComSpec under Windows NT/2000/XP/2003/Vista.
- ENV
-
The value of this variable is the name of a file of MKS KornShell commands, or else be null. When the MKS KornShell is invoked, the file named by ENV is executed before the MKS KornShell does anything else. Thus your ENV file may contain definitions of aliases, shell functions, and son on that may be used by shell scripts. Note that your ENV file is executed, whether or not the MKS KornShell is invoked as a login shell. This differs from older releases of the MKS KornShell.
- HASHBANG
-
If this variable is set then the #! feature of the MKS KornShell is enabled.
- HOME
-
This variable is set by the shell's default startup files. It contains the name of your home directory. Your home directory is the default directory for the cd command built into the MKS KornShell.
- LIBGL_ALWAYS_INDIRECT
-
disables Direct Rendering for NuTCRACKER Platform X applications. When this environment variable is set, X applications running on the NuTCRACKER Platform always use indirect rendering regardless of the settings for the X Server itself.
- LINES
-
If you set this variable to a numeric value, various commands use its value as the number of lines available on the output device. This overrides the default.
- LOGNAME
-
This variable is set by the shell's default startup files. It holds the user name of the current user.
- MAILER
-
For commands that send mail, this variable points at a mail delivery program. If this variable is not set, then the default mailer, mailx is invoked.
- PATH
-
This variable is set to a default value when you start the MKS KornShell. Normally, it is also set in your profile file. It lists the directories that are to be searched to find commands, as described in sh.
- ROOTDIR
-
Because Windows systems have a multi-device file system, it is necessary to provide the location of the standard root directory for system files (for example, /etc/profile.ksh and /tmp). This variable contains a device name and possibly a directory where such files are found.
- SHELL
-
This variable contains the full path name of the current shell. Note that if SHELL is not defined, all commands that require the full path name of the current shell use the contents of the environment variable COMSPEC.
- TERM
-
This variable contains the terminal type. When MKS Toolkit is installed, this variable is set to nutc. It should not be changed from this value or some utilities may not work correctly.
- TK_ASPI_SUPPORT_OFF
-
When this variable is set, MKS Toolkit tape-handling utilities do not use ASPI support if it is present and do not display warning messages if it is not.
- TK_GLOB_INSIDE_QUOTES
-
When this variable is set and you are running a MKS utility from the cmd.exe command line, globbing is supported inside quotes.
- TK_GUI_SUBSYSTEM_NOT_SUPPORTED
-
When this variable is set, the ability of MKS Toolkit utilities to launch GUI applications is turned off.
- TK_NTLINKS_OFF
-
MKS Toolkit supports hard links under Windows NT/2000/XP/2003/Vista on NTFS file systems. There is a slight loss of performance for this support. If you do not require hard link support then you should set and export the environment variable TK_NTLINKS_OFF to disable this support.
- TK_NTSECURITYINFO_LOCAL
-
When set, MKS Toolkit uses local security information. This variable overrides TK_NTSECURITYINFO_OFF.
- TK_NTSECURITYINFO_OFF
-
MKS Toolkit supports Windows NT/2000/XP/2003/Vista security information on NTFS file systems. There is a slight loss of performance for this support. If you do not require any security information then you should set and export the environment variable TK_NTSECURITYINFO_OFF to disable this feature.
- TK_NTSECURITYINFO_SID_TERSE
-
Under Windows NT/2000/XP/2003/Vista, when using ls with the
-l option, files having an associated SID, whose name cannot be determined, display the value of the SID instead. SID values are usually very large. You should set and export the TK_NTSECURITYINFO_SID_TERSE environment variable. This causes all SID values to be shortened by replacing all the subauthority values, except the last one, by the string "-...-". - TK_PATH_CONVERT
-
Determines whether or environment variables that are considered to contain path names are displayed in Windows or UNIX format. When this variable is set to UNIX (this value is case-insensitive), such an enivronment variable is displayed in UNIX format; otherwise, it is displayed in Windows format. See the Environment Variables and Paths section of the EUCM reference page for more information.
- TK_PATH_SAME_IN_CHILD
-
When this environment variable is set, forward slashes in the PATH environment variable of child processes are not converted to backslashes. Normally, all slashes in the PATH of child processes are converted internally to backslashes for compatibility with the Windows
ShellExecute() function; however, this conversion can cause problems in other ares. As a result, setiing this variable avoids those other problems but will cause theShellExecute() function to not work.This variable is best used when you don't want forward slashes in the PATH of a child process converted and you don't require
ShellExecute() to work. - TK_PERL_USE_COMSPEC
-
When set, this environment variable causes perl to use the contents of the environment variable COMSPEC as the full path name of the current shell, whether or not the environment variable SHELL is set.
- TK_PIPE_BUF_SIZE
-
When set, the value of this environment variable is size of the pipe buffer in kilobytes. When this value is less than 5k, a buffer size of 5k is used. When this value is greater than 256k, a buffer size of 256k is used.
The default pipe buffer size on is 32k.
- Note:
-
When using a processor with hyperthreading enabled, you should experiment with different values for this environment variable to see which buffer size results in the best performance when using pipes.
- TK_PRE90_CMDLINE_PROCESSING
-
When this variable is set and MKS argument passing is not used, executable files (that is, those with .exe extensions) truncate their command lines after the command name.
- TK_STDIO_DEFAULT_INPUT_FORMAT
-
Sets the default input format for files that don't have the initial multibyte marker. The value must be one of those listed in the File Character Formats section of the unicode reference page.
- TK_STDIO_DEFAULT_OUTPUT_FORMAT
-
Sets the default output format. Normally the format of the first file read is used as the default output format. The value must be one of those listed in the File Character Formats section of the unicode reference page.
- TK_SUFFIXED_SEARCHING_FIRST
-
By default, MKS Toolkit utilities first search for a command exactly as typed by the user, and if not found, then search for it using file name extensions as described in the Command Execution section of the sh reference page.
When the TK_SUFFIXED_SEARCHING_FIRST environment variable is set, this process is reversed. The command is first searched for using file name extensions and then, if not found, it is searched for exactly as typed by the user.
Consider the following:
echo "echo search_test" > search_test echo "echo search_test.ksh" > search_test.ksh PATH="$PATH;" unset TK_SUFFIXED_SEARCHING_FIRST search_test export TK_SUFFIXED_SEARCHING_FIRST=1 search_test unset TK_SUFFIXED_SEARCHING_FIRST search_test
The output from the above is:
search_test search_test.ksh search_test
- TK_TREAT_UNIXPATH_AS_PATH
-
This variable contains a semicolon-separated list of UNIX-style directory names (for example, /usr/bin;/bin). When an MKS Toolkit shell or utility cannot find a command and the directory portion of the command appears in this list, a standard path search is performed for the base file name of the command and the first match found is used instead.
For example, if /usr/bin/ls does not exist on your current drive and TK_TREAT_UNIXPATH_AS_PATH contains /usr/bin, then:
which /usr/bin/ls
returns the first ls found by a path search.
- TK_USE_CTRLD_AS_CONSOLE_EOF
-
When set, allows the use of CTRL-D as the EOF (end-of-file) character for the MKS KornShell (including sh, bash, ksh and resh) and MKS C Shell as well as for any utility that can accept input from the console.
- TK_PATH_CONVERT
-
Determines whether or environment variables that are considered to contain path names are displayed in Windows or UNIX format. When this variable is set to UNIX (this value is case-insensitive), such an enivronment variable is displayed in UNIX format; otherwise, it is displayed in Windows format. See the Environment Variables and Paths section of the EUCM reference page for more information.
- TK_UNIX_FILESYSTEM
-
When this variable is set, the Enhanced UNIX Compatibility Mode is on and the virtual file system is in use. For more information, see the EUCM reference page.
- TK_USE_CURRENT_LOCALE
-
When set, this environment variable causes months and days of the week to be displayed as defined in the current locale. By default, MKS Toolkit utilities display months and days of the week in English.
- TK_WOW64FSREDIR_ON
-
When set, this environment variable turns on file system redirection on 64-bit Windows systems.
On 64-bit systems, Windows system files for 64-bit applications are stored in the $WINDIR/System32 directory. To avoid confusion, the system files for 32-bit applications are stored in the $WINDIR/SysWOW64 directory.
When file system redirection is on, both 64-bit and 32-bit applications can find the correct corresponding systems files without explicitly indicating the $WINDIR/System32 or $WINDIR/SysWOW64 directory. However, this means that files in $WINDIR/System32 are effectively invisible to 32-bit applications and files in $WINDIR/SysWOW64 are effectively invisible to 64-bit applications.
When file system redirection is off, both 64-bit and 32-bit applications can access system files in both the $WINDIR/System32 and $WINDIR/SysWOW64 directories; however, the directory must be explicitly specified.
By default, this variable is unset and file system redirection is off.
- TMPDIR
-
By default, MKS Toolkit commands store temporary files under /tmp. To use a different directory for temporary files, set TMPDIR to the name of the directory you want to use.
- TZ
-
Commands that print times (and dates) use this variable to determine the time zone. If the TZ variable is left undefined, the operating system's current time zone setting is used. See timezone for details. On Windows, the MKS Toolkit makes use of the built-in timezone support, and you should not set the TZ environment variable.
PORTABILITY
The standard names on Windows systems are a superset of those used by UNIX programs, with COMSPEC (ComSpec under Windows NT/2000/XP/2003/Vista), ROOTDIR and TK_* being the major additions.
AVAILABILITY
MKS Toolkit for Power Users
MKS Toolkit for System Administrators
MKS Toolkit for Developers
MKS Toolkit for Interoperability
MKS Toolkit for Professional Developers
MKS Toolkit for Enterprise Developers
MKS Toolkit for Enterprise Developers 64-Bit Edition
MKS Source Integrity Standard
MKS Source Integrity Enterprise Edition
SEE ALSO
MKS Toolkit 9.2 Documentation Build 16.