Difference between revisions of "Env"

From MiniScript Wiki
Jump to navigation Jump to search
Line 32: Line 32:
 
[[Category:Mini Micro]]
 
[[Category:Mini Micro]]
 
[[Category:Command-Line MiniScript]]
 
[[Category:Command-Line MiniScript]]
 +
[[Category:Farmtronics]]

Revision as of 19:42, 26 January 2022

env is a built-in map in both Mini Micro and command-line MiniScript. It has somewhat different meaning and usage in each environment.

Mini Micro

In Mini Micro, env refers to a map of special values that affect the Mini Micro environment. It contains at least the following keys:

Key Meaning
bootOpts a complete copy of the data in the bootOpts.grfon file
curdir current working directory (same as pwd)
cmdLine command line command that was used to launch Mini Micro (where applicable)
cmdLineArgs command line arguments (as a list) used when Mini Micro was launched (where applicable)
importPaths list of directories searched for import modules
prompt string printed as the command-line prompt
morePrompt string printed as the prompt when more input is needed

Command-Line MiniScript

In command-line MiniScript, env is a copy of the shell environment variables. Assignments to entries of env add or update environment variables. (Deleting environment variables is not possible; you may delete from the env map, but this does not actually affect the environment.)

The exact meaning of environment variables varies with the platform. They have many uses, such as in CGI scripts.