Dec 082017
Show DOS environment strings (w/ C src).
File SHOWENV.ZIP from The Programmer’s Corner in
Category C Source Code
Show DOS environment strings (w/ C src).
File Name File Size Zip Size Zip Type
SHOWENV.C 548 284 deflated
SHOWENV.DOC 2056 858 deflated
SHOWENV.EXE 7405 4967 deflated

Download File SHOWENV.ZIP Here

Contents of the SHOWENV.DOC file


SHOWENV is a utility program that displays the contents of one or all of
the DOS environment variables. Many programs now make use of environment
variables to read command line specifications. For example, if you use the
Microsoft C 5.0 compiler, you may put the line


in your AUTOEXEC.BAT file. This creates an environment variable named CL and
sets it equal to the string "/AL /Zi". When you invoke the Microsoft C 5.0
compiler, it searches for the CL variable and interprets its contents as
command line options. For instance, the above example would cause the compiler
to compile for the large memory model, and prepare the object file for the
CODEVIEW debugger. Once the CL variable is set, there is no need to put the
options on the command line, as the compiler will check the CL variable.

SHOWENV is useful for checking what environment variables are set to.
The source code for SHOWENV is included, and can be useful in demonstrating
how to read environment variables and command line options.

Syntax: SHOWENV [variable]
If [variable] is specified, the list of environment variables is searched
for the specified variable. Program output consists of the contents of that
environment variable, or a message that it is not in the table.

If no variable is specified on the command line, the entire table of
environment variables is displayed.

This will display the contents of the CL environment variable.

This will display all of the variables in the environment table.

SHOWENV has been placed in the public domain by the author. You are
encouraged to distribute it to bulletin boards and user groups. The author can
be reached at:
Larry Gritz
200 Kimblewick Drive
Silver Spring, MD 20904

 December 8, 2017  Add comments

Leave a Reply