Maple Professional
Maple Academic
Maple Student Edition
Maple Personal Edition
Maple Player
Maple Player for iPad
MapleSim Professional
MapleSim Academic
Maple T.A. - Testing & Assessment
Maple T.A. MAA Placement Test Suite
Möbius - Online Courseware
Machine Design / Industrial Automation
Aerospace
Vehicle Engineering
Robotics
Power Industries
System Simulation and Analysis
Model development for HIL
Plant Modeling for Control Design
Robotics/Motion Control/Mechatronics
Other Application Areas
Mathematics Education
Engineering Education
High Schools & Two-Year Colleges
Testing & Assessment
Students
Financial Modeling
Operations Research
High Performance Computing
Physics
Live Webinars
Recorded Webinars
Upcoming Events
MaplePrimes
Maplesoft Blog
Maplesoft Membership
Maple Ambassador Program
MapleCloud
Technical Whitepapers
E-Mail Newsletters
Maple Books
Math Matters
Application Center
MapleSim Model Gallery
User Case Studies
Exploring Engineering Fundamentals
Teaching Concepts with Maple
Maplesoft Welcome Center
Teacher Resource Center
Student Help Center
getenv - fetch the contents of a system environment variable
Calling Sequence
getenv(name)
getenv(regentry,registry) (Windows only)
Parameters
name
-
the name of the environment variable to fetch
regentry
a list of three strings, the registry key, the value path and value name
Description
Looks up the specified system environment variable and returns its value as a Maple string. If the specified variable is not defined, getenv will return NULL.
A system environment variable is one that is set in the shell from which Maple was invoked. For example, under the UNIX C Shell, such variables are assigned using the setenv command. Under MS-DOS, such variables are assigned using the set command.
The set of available environment variables, and their meanings, is operating system dependent. Maple procedures or worksheets that make use of the getenv function will not likely be portable between versions of Maple for different operating systems.
Note: Issuing a shell command (via Maple's system function) to set the value of an environment variable will not be reflected in subsequent calls to getenv. This is because the system function spawns a sub-shell, and changes to a sub-shell's environment will not affect the shell from which Maple was invoked.
In the Windows versions of Maple, getenv can also be used to query values from the Windows registry. In this case, the first argument is a list of three strings, the registry key ("HKEY_LOCAL_MACHINE", "HKEY_CURRENT_USER", etc ), the value's path and the value's name and the second argument is the name registry.
Examples
This is only valid on a Windows system
See Also
system
Download Help Document