Category : Batch File Utilities - mostly for DOS
Archive   : RBSETENV.ZIP
Filename : SETENV.NRO
.SH NAME
setenv \- set environment variables, with command and
variable substitution
.SH SYNOPSIS
.B setenv
variable [argument ... ]
.SH DESCRIPTION
.I setenv
is a utility to set DOS environment variables, performing wildcard
expansion, command substitution and variable substitution on the arguments
before assigning to the variable. The command line is iteratively scanned
for command substitutions in backquotes (`...`) and environment variables
(%var), and the resulting text used as the value of the environment variable
named in the first argument. Command substitutions are usually performed by
calling loading a shell to run the command. If the first character
of the command is '@', the command is exec'ed directly (faster
than loading a shell, but only works with exe and com files). The magic
characters '%','`', and '@' are set by #defines in comsub.h so you can change
them if you don't like them.
.PP
When substituting the output of commands, newlines are replaced by spaces.
Arguments may need to be quoted in order that
.I setenv
will see the "%" or "`...`"
characters, depending on which shell you use. The 4DOS shell in particular
needs to have backquotes protected by double quotes.
Since variable expansion is
performed internally, environment variables may be set to values longer than
the 127 character limit enforced by the MSDOS command line length.
.SH DIAGNOSTICS
Diagnostics are printed for the following errors:
.nf
- unable to locate environment
- environment overflow
- out of memory
- command substitution failed (command not found, or line too long)
.fi
.SH EXAMPLES
setenv cwd `cd`
.SH "SEE ALSO"
eval, incr, decr, expr
.SH BUGS
Tested with 4dos and command shells. With ms_sh bourne shell, this program
modifies what DOS thinks is the environment of the shell, but this does not
seem to be what is passed on to child processes.
.PP
Command.com (at least version 4.01) has trouble displaying long
environment variables with the SET command, even though they are in fact
correctly created by
.I setenv.
.SH AUTHOR
Richard Brittain ([email protected])
Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!
This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.
But one thing that puzzles me is the “mtswslnkmcjklsdlsbdmMICROSOFT” string. There is an article about it here. It is definitely worth a read: http://www.os2museum.com/wp/mtswslnk/